Add linux package function
This commit is contained in:
parent
67530358a0
commit
4bc4e44db7
1 changed files with 27 additions and 1 deletions
28
utility.sh
28
utility.sh
|
@ -9,7 +9,8 @@ print_help()
|
|||
echo
|
||||
echo "Options:"
|
||||
echo " -i, --install Install SimplePanoramaViewer in PATH_TO_INSTALL_DIR"
|
||||
echo " -u, --uninstall Uninstall SimplePanoramaViewer frome PATH_TO_INSTALL_DIR"
|
||||
echo " -u, --uninstall Uninstall SimplePanoramaViewer from PATH_TO_INSTALL_DIR"
|
||||
echo " -p, --package Generate a package for SimplePanoramaViewer"
|
||||
}
|
||||
|
||||
check_dir()
|
||||
|
@ -52,6 +53,28 @@ uninstall()
|
|||
rm "$DIR/share/mime/image/pjpg.xml"
|
||||
}
|
||||
|
||||
package()
|
||||
{
|
||||
DIR="/tmp/SimplePanoramaViewer"
|
||||
|
||||
mkdir "$DIR"
|
||||
cp SimplePanoramaViewer "$DIR"
|
||||
cp -r css "$DIR"
|
||||
cp -r html "$DIR"
|
||||
cp -r js "$DIR"
|
||||
chmod a+x "$DIR/SimplePanoramaViewer"
|
||||
|
||||
mkdir -p dist
|
||||
cd /tmp || exit
|
||||
tar Jcvf "SimplePanoramaViewer.tar.xz" "SimplePanoramaViewer"
|
||||
|
||||
cd - || exit
|
||||
cp -f "$DIR.tar.xz" dist
|
||||
|
||||
rm -r "$DIR"
|
||||
rm "$DIR.tar.xz"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"-h" | "--help")
|
||||
print_help
|
||||
|
@ -62,6 +85,9 @@ case "$1" in
|
|||
"-u" | "--uninstall")
|
||||
uninstall "$2"
|
||||
;;
|
||||
"-p" | "--package")
|
||||
package
|
||||
;;
|
||||
*)
|
||||
print_help
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue