appimage: Make spacing consistent

This commit is contained in:
Mike Salvatore 2021-04-29 12:54:49 -04:00
parent 84c875c396
commit 68759e3970
1 changed files with 38 additions and 38 deletions

View File

@ -49,22 +49,22 @@ install_nodejs() {
} }
install_build_prereqs() { install_build_prereqs() {
sudo apt update sudo apt update
sudo apt upgrade -y sudo apt upgrade -y
# monkey island prereqs # monkey island prereqs
sudo apt install -y curl libcurl4 openssl git build-essential moreutils sudo apt install -y curl libcurl4 openssl git build-essential moreutils
install_nodejs install_nodejs
} }
install_appimage_tool() { install_appimage_tool() {
APP_TOOL_BIN=$WORKSPACE/bin/appimagetool APP_TOOL_BIN=$WORKSPACE/bin/appimagetool
mkdir -p "$WORKSPACE"/bin mkdir -p "$WORKSPACE"/bin
curl -L -o "$APP_TOOL_BIN" "$APP_TOOL_URL" curl -L -o "$APP_TOOL_BIN" "$APP_TOOL_URL"
chmod u+x "$APP_TOOL_BIN" chmod u+x "$APP_TOOL_BIN"
PATH=$PATH:$WORKSPACE/bin PATH=$PATH:$WORKSPACE/bin
} }
clone_monkey_repo() { clone_monkey_repo() {
@ -78,34 +78,34 @@ clone_monkey_repo() {
} }
setup_appdir() { setup_appdir() {
setup_python_37_appdir setup_python_37_appdir
copy_monkey_island_to_appdir copy_monkey_island_to_appdir
download_monkey_agent_binaries download_monkey_agent_binaries
install_monkey_island_python_dependencies install_monkey_island_python_dependencies
install_mongodb install_mongodb
generate_ssl_cert generate_ssl_cert
build_frontend build_frontend
add_monkey_icon add_monkey_icon
add_desktop_file add_desktop_file
add_apprun add_apprun
} }
setup_python_37_appdir() { setup_python_37_appdir() {
PYTHON_APPIMAGE="python${PYTHON_VERSION}_x86_64.AppImage" PYTHON_APPIMAGE="python${PYTHON_VERSION}_x86_64.AppImage"
rm -rf "$APPDIR" || true rm -rf "$APPDIR" || true
log_message "downloading Python3.7 Appimage" log_message "downloading Python3.7 Appimage"
curl -L -o "$PYTHON_APPIMAGE" "$PYTHON_APPIMAGE_URL" curl -L -o "$PYTHON_APPIMAGE" "$PYTHON_APPIMAGE_URL"
chmod u+x "$PYTHON_APPIMAGE" chmod u+x "$PYTHON_APPIMAGE"
./"$PYTHON_APPIMAGE" --appimage-extract ./"$PYTHON_APPIMAGE" --appimage-extract
rm "$PYTHON_APPIMAGE" rm "$PYTHON_APPIMAGE"
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
} }
copy_monkey_island_to_appdir() { copy_monkey_island_to_appdir() {
@ -201,25 +201,25 @@ remove_node_modules() {
} }
add_monkey_icon() { add_monkey_icon() {
unlink "$APPDIR"/python.png unlink "$APPDIR"/python.png
mkdir -p "$APPDIR"/usr/share/icons mkdir -p "$APPDIR"/usr/share/icons
cp "$REPO_MONKEY_SRC"/monkey_island/cc/ui/src/images/monkey-icon.svg "$APPDIR"/usr/share/icons/infection-monkey.svg cp "$REPO_MONKEY_SRC"/monkey_island/cc/ui/src/images/monkey-icon.svg "$APPDIR"/usr/share/icons/infection-monkey.svg
ln -s "$APPDIR"/usr/share/icons/infection-monkey.svg "$APPDIR"/infection-monkey.svg ln -s "$APPDIR"/usr/share/icons/infection-monkey.svg "$APPDIR"/infection-monkey.svg
} }
add_desktop_file() { add_desktop_file() {
unlink "$APPDIR/python${PYTHON_VERSION}.desktop" unlink "$APPDIR/python${PYTHON_VERSION}.desktop"
cp ./infection-monkey.desktop "$APPDIR"/usr/share/applications cp ./infection-monkey.desktop "$APPDIR"/usr/share/applications
ln -s "$APPDIR"/usr/share/applications/infection-monkey.desktop "$APPDIR"/infection-monkey.desktop ln -s "$APPDIR"/usr/share/applications/infection-monkey.desktop "$APPDIR"/infection-monkey.desktop
} }
add_apprun() { add_apprun() {
cp ./AppRun "$APPDIR" cp ./AppRun "$APPDIR"
} }
build_appimage() { build_appimage() {
log_message "Building AppImage" log_message "Building AppImage"
ARCH="x86_64" appimagetool "$APPDIR" ARCH="x86_64" appimagetool "$APPDIR"
} }
if is_root; then if is_root; then