diff --git a/package.json b/package.json index 53edeb3..e0b3eed 100644 --- a/package.json +++ b/package.json @@ -23,14 +23,10 @@ "mkdirp": "^0.5.1" }, "build": { - "nwVersion": "0.35.5", - "targets": [ - "zip" - ] + "nwVersion": "0.35.5" }, "scripts": { - "dist": "build --tasks win-x64,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ . --concurrent", - "mac": "build --tasks mac-x64 --mirror https://dl.nwjs.io/ . --concurrent" + "dist": "./scripts/build.sh" }, "devDependencies": { "nwjs-builder-phoenix": "^1.15.0" diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..8a381f2 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +build --tasks win-x64,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ . --concurrent +cp ./scripts/memex-backup-helper.desktop ./dist/memex-backup-helper-*-linux-x64/ +cd ./dist/memex-backup-helper-*-linux-x64/ +mkdir src +# allow ! by setting dotglob in optional shell behavior +shopt -s extglob dotglob +mv !(src) ./src/ +# unset dotglob for default bash behavior +shopt -u dotglob +cd ./../../ +cp ./scripts/linux-installer.sh ./dist/memex-backup-helper-*-linux-x64/ +chmod +x ./dist/memex-backup-helper-*-linux-x64/linux-installer.sh +echo ./dist/memex-backup-helper-*-x64 | xargs -n 1 cp ./scripts/readme.URL +cd ./dist +# zip the dist directories +# disabled because of super huge filesize using zip for the mac folder +# find . -iname "memex-backup-helper-*-x64" -print0 -maxdepth 1 | xargs -0 -I folder zip -r ./folder.zip ./folder \ No newline at end of file diff --git a/scripts/linux-installer.sh b/scripts/linux-installer.sh new file mode 100644 index 0000000..e10e8c7 --- /dev/null +++ b/scripts/linux-installer.sh @@ -0,0 +1,6 @@ +#!/bin/sh +mkdir -p ~/.memex-backup-helper +cd ./src +sed -e "s/%%user%%/$USER/g" ./memex-backup-helper.desktop > ~/.local/share/applications/memex-backup-helper.desktop +\cp -r ./* ~/.memex-backup-helper/ +rm ~/.memex-backup-helper/memex-backup-helper.desktop \ No newline at end of file diff --git a/scripts/memex-backup-helper.desktop b/scripts/memex-backup-helper.desktop new file mode 100755 index 0000000..f41274b --- /dev/null +++ b/scripts/memex-backup-helper.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Terminal=false +Exec=/home/%%user%%/.memex-backup-helper/memex-backup-helper +Name=Memex Backup Helper +Comment=Memex Local Backup Helper +Icon=/home/%%user%%/.memex-backup-helper/img/appIcon.png +Categories=Application; \ No newline at end of file diff --git a/scripts/readme.URL b/scripts/readme.URL new file mode 100644 index 0000000..47b2ebc --- /dev/null +++ b/scripts/readme.URL @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://www.notion.so/worldbrain/Download-Memex-Backup-App-7dacad9e95b44c5db681033fc264fb59 \ No newline at end of file