From 724872c7edbb132d4ef701eb7b761fe9be6ac018 Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Sat, 20 Jan 2024 19:42:39 +0300 Subject: [PATCH] Fixed license setting --- repack.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/repack.sh b/repack.sh index 9aef2fc..db6303a 100644 --- a/repack.sh +++ b/repack.sh @@ -25,17 +25,14 @@ usage() { echo echo " Options:" echo " -x Extract and fix only to ./app folder" - echo " -l Do not update license" echo " -h Show this help and exit" } extract_only= exe_location= -update_license=1 while getopts :xlh name; do case $name in x) extract_only=1 ;; - l) update_license= ;; h) usage exit 0 @@ -72,18 +69,6 @@ rm "./app.asar" cd ./app -if [ -z "$update_license" ]; then - # updating license - if ! command -v jq &>/dev/null; then - echo "Error: jq is not installed. Please install jq to proceed." >&2 - exit 1 - fi - jq --arg license "UNLICENSED" '. + {license: $license}' package.json > tmp_package.json - mv tmp_package.json package.json - echo "Updated license field in package.json" - version=$(jq -r .version package.json) -fi - # fixing secretKey issue echo "Fixing SecretKey" find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= read -r -d $'\0' file; do @@ -152,6 +137,25 @@ forge_config="module.exports = { echo Writing Forge Config... echo "$forge_config" > ./forge.config.js + +update_license=0 +if prompt_yes_no "In order to build the app we'll need to update the license field in package.json. Continue?"; then + update_license=1 +fi + +if [ "$update_license" -eq 1 ]; then + exit 0 +fi + +if ! command -v jq &>/dev/null; then + echo "Error: jq is not installed. Please install jq to proceed." >&2 + exit 1 +fi +jq --arg license "UNLICENSED" '. + {license: $license}' package.json > tmp_package.json +mv tmp_package.json package.json +echo "Updated license field in package.json" +version=$(jq -r .version package.json) + build_x64=0 build_arm64=0