Change install script fix data directory

This commit is contained in:
Alexander Rosenberg 2022-11-02 14:50:36 -07:00
parent b030dec3d0
commit 250e8b09b0
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
PREFIX="/usr/local"
@ -7,8 +7,12 @@ if [ "$#" -ge 1 ]; then
fi
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"
rm -rf "$GLOBAL_DATA_PATH"
cp -R licenses "$GLOBAL_DATA_PATH"
EOF

View File

@ -58,6 +58,7 @@ fn get_outfile(args: &Vec<String>) -> Option<&str> {
fn print_help(user_data_file: &String) {
println!("license-tool [-h] [-o OUTFILE] <license>");
println!("Global License Dir: {}", GLOBAL_DATA_PATH);
println!("User License Dir: {}", user_data_file);
let mut user_dirs = HashSet::<String>::new();
let user_dir = fs::read_dir(user_data_file);