Skip to content

Commit

Permalink
Merge pull request #489 from jinko-core/install-jk
Browse files Browse the repository at this point in the history
install: Add WIP install jinko script
  • Loading branch information
CohenArthur authored Mar 20, 2022
2 parents 10149dc + 8cbe381 commit 656fd10
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions install.jk
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
incl oslib

home = Env(name: "HOME").get();
jk_dir = home.concat("/.jinko/");

bin_dir = jk_dir.concat("bin");
lib_dir = jk_dir.concat("libs");

println("Setting up standard library...");

Dir(path: bin_dir).create();
Dir(path: lib_dir).create();

cp_result = shell("cp -r stdlib {lib_dir}");
if cp_result != 0 {
println_err("Failed to copy standard library");
exit(1);
}

if File(path: "Cargo.toml").exists() {
println("Compiling jinko from source...");

shell("cargo build --release");
print("jinko version: ");
shell("target/release/jinko -v");
println("");

shell("cp target/release/jinko {bin_dir}");
} else {
print("Installing jinko from a release...");
shell("./jinko -v");

shell("cp jinko {bin_dir}");
}

println("jinko is installed! Remember to add {jk_dir} to your path!")

0 comments on commit 656fd10

Please sign in to comment.