eventOneHQ / apkup

🚀 Publish APKs to Google Play directly from the terminal
https://oss.eventone.page/apkup
MIT License
36 stars 12 forks source link

"Unable to parse release notes" for release notes that includes spaces #35

Closed chenop closed 4 years ago

chenop commented 4 years ago

apkup: v1.3.0 node: v13.13.0 shell: zsh

Trying use the following option --release-notes 'en-US=Fixing Floating Button' Got: " Unable to parse release notes"

Trying: --release-notes 'en-US=Fixing_Floating_Button' Works!

nprail commented 4 years ago

What version of apkup and Node are you using? Also, what shell?

Does it work if you use double quotes?

chenop commented 4 years ago

Thanks for checking this out. Updated versions in the question.

It does not work for double quotes well.

nprail commented 4 years ago

Okay. Try again but first run:

export DEBUG=apkup:*

Then paste the full output here. Make sure you redact any sensitive info, though.

chenop commented 4 years ago

/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:1132 throw err; ^

AssertionError [ERR_ASSERTION]: Unable to parse release notes at Object.handler (/path/to/project/node_modules/apkup/dist/cli/upload.js:52:34) at Object.runCommand (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/command.js:196:48) at Object.parseArgs [as _parseArgs] (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:1053:51) at Object.get [as argv] (/path/to/project/node_modules/apkup/node_modules/yargs/build/lib/yargs.js:986:25) at Object. (/path/to/project/node_modules/apkup/dist/cli/index.js:32:18) at Module._compile (internal/modules/cjs/loader.js:1123:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10) at Module.load (internal/modules/cjs/loader.js:972:32) at Function.Module._load (internal/modules/cjs/loader.js:872:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { generatedMessage: false, code: 'ERR_ASSERTION', actual: false, expected: true, operator: 'strictEqual' }

nprail commented 4 years ago

There are two strictEqual checks on the release notes. One checks to make sure that there is an = in the string and then the other splits the string on the = and makes sure that there are two strings as a result. I can't tell which is failing because one check is on line 51 and the other is on line 53 whereas your error message says line 52.

But neither of them should fail and neither should having spaces or not be any different. I'm guessing that it isn't getting the string correctly.

Open node_modules/apkup/dist/cli/upload.js and at about line 50 add a console.log:

var change = _a[_i]; // right after this
console.log(change); // add this

Then run it again. I bet that it will be null or undefined.

chenop commented 4 years ago

Tl;Dr - was not apkup fault, I apologize for wasting your time and appreciate your support.

How do I use apkup? I have a bash script that deploys my app to the play store. It receive the following parameters: ./deployAndroidToPlayStore.sh -c [version code] -n [version name] -r [release notes] Example: ./deployAndroidToPlayStore.sh -c 57 -n "1.20.3" -r 'Fixing Floating Button'

I use the first 2 parameters for building: ./gradlew bundleRelease -PversionCode=$c -PversionName=$n

and here is the wrong way of how I invoked apkup with the release notes: apkup --key key.json --track beta --apk /path/to/app-release.aab --release-notes $r

It turns out its not the right way to do it inside a bash script, after trial and error I came to this:

cmd="apkup --key key.json --track beta --apk /path/to/app-release.aab --release-notes ${r}" 
echo $cmd  
eval $cmd

This way the release parameter are being passed fine to apkup. So in the end it was a bash issue - leaving this cause maybe it will help someone in the future. Your last comment helped me to debug it - Thanks!

nprail commented 4 years ago

Awesome, I'm glad you figured it out! I was starting to wonder if it was some sort of quote evaluation issue with bash. I've run into similar problems before... It can be quite difficult to debug.