From a0b8badf429a559f2de7176fba8184e436bd9ff4 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Fri, 10 May 2024 19:37:00 +0200 Subject: Initial commit --- converter/convert_darwin_x64.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 converter/convert_darwin_x64.sh (limited to 'converter/convert_darwin_x64.sh') diff --git a/converter/convert_darwin_x64.sh b/converter/convert_darwin_x64.sh new file mode 100755 index 0000000..79ba101 --- /dev/null +++ b/converter/convert_darwin_x64.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +me="$(realpath "$(dirname "$0")")" + +if [ ! -d "$1" ]; then + echo "$0: No such file or directory" + exit +fi + +if [ ! -f "$1/Contents/Frameworks/Electron Framework.framework/Electron Framework" ]; then + echo "$0: Application is not a valid Atomic application" + exit +fi + +original=$(du -hs "$1" | awk '{print $1;}') + +executable="" +for i in "$1/Contents/MacOS/"*; do executable="$i"; done + +echo "$0: Executable found at $executable" + +echo "$0: Copying launcher" +rm -f "$executable" +cp "$me/launcher-darwin-x64" "$executable" + +echo "$0: Removing built-in Electron" +rm -rf "$1/Contents/Frameworks" +for i in "$1/Contents/Resources/"*; do + if [[ "$i" == */app ]] || [[ "$i" == */electron.icns ]]; then + true + else + rm -rf "$i" + fi +done + +new=$(du -hs "$1" | awk '{print $1;}') + +echo "$0: Completed. Was $original, is now $new." -- cgit