pulsar-titanium
pulsar-titanium copied to clipboard
Current path wrong (e.g. in hooks)
When compiling with Atom the path of the hook will be wrong: https://github.com/hansemannn/titanium-crashlytics/blob/master/android/hooks/gradle_plugins.js#L22
Atom:
/home/miga/build/android/build.gradle
:x:
using the CLI inside the app folder or VSCode:
/home/miga/dev/titanium/test_firebase_messaging/build/android/build.gradle
:heavy_check_mark:
I think maybe the run function might need changing to set an options
argument that includes a cwd
that is set to the project directory.
While that change should be made, I think to be safe the hook should also do something like the below rather than path.resolve
. As path.resolve
will work with the current working directory of the command which isn't always guaranteed to match the specified --project-dir
command.
const projectBuildGradle = path.join(cli.argv['project-dir'], 'build', 'android', 'build.gradle');
sounds good too! Didn't know that the parameters can just be grabbed like this cli.argv['project-dir']
:+1:
Since VSCode was working correctly I thought it would be easier to have the run function to run in that folder as other hooks might be a problem too.
I'll test it with your example code, thanks
Just a note:
The same occours on iOS using Firebase-Crashlytics for dsymPaths:
Atom:
/build/iphone/build/Products/Release-iphoneos
❌
using the CLI inside the app folder or VSCode:
/Users/jordanbisato/Projetos/CVP-Aplicativo-Front/build/iphone/build/Products/Release-iphoneos
✔️