Change install script fix data directory
This commit is contained in:
parent
b030dec3d0
commit
250e8b09b0
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
|
|
||||||
PREFIX="/usr/local"
|
PREFIX="/usr/local"
|
||||||
|
|
||||||
@ -7,8 +7,12 @@ if [ "$#" -ge 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export GLOBAL_DATA_PATH="$PREFIX/share/license-tool"
|
export GLOBAL_DATA_PATH="$PREFIX/share/license-tool"
|
||||||
|
cargo clean --release
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
cargo install --path . --root "$PREFIX"
|
sudo sh << EOF
|
||||||
|
cp target/release/license-tool "$PREFIX/bin/license-tool"
|
||||||
printf "Installing licenses to '%s'\n" "$GLOBAL_DATA_PATH"
|
printf "Installing licenses to '%s'\n" "$GLOBAL_DATA_PATH"
|
||||||
rm -rf "$GLOBAL_DATA_PATH"
|
rm -rf "$GLOBAL_DATA_PATH"
|
||||||
cp -R licenses "$GLOBAL_DATA_PATH"
|
cp -R licenses "$GLOBAL_DATA_PATH"
|
||||||
|
EOF
|
||||||
|
@ -58,6 +58,7 @@ fn get_outfile(args: &Vec<String>) -> Option<&str> {
|
|||||||
|
|
||||||
fn print_help(user_data_file: &String) {
|
fn print_help(user_data_file: &String) {
|
||||||
println!("license-tool [-h] [-o OUTFILE] <license>");
|
println!("license-tool [-h] [-o OUTFILE] <license>");
|
||||||
|
println!("Global License Dir: {}", GLOBAL_DATA_PATH);
|
||||||
println!("User License Dir: {}", user_data_file);
|
println!("User License Dir: {}", user_data_file);
|
||||||
let mut user_dirs = HashSet::<String>::new();
|
let mut user_dirs = HashSet::<String>::new();
|
||||||
let user_dir = fs::read_dir(user_data_file);
|
let user_dir = fs::read_dir(user_data_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user