pulsar-titanium icon indicating copy to clipboard operation
pulsar-titanium copied to clipboard

Current path wrong (e.g. in hooks)

Open m1ga opened this issue 2 years ago • 3 comments

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:

m1ga avatar Nov 22 '21 18:11 m1ga

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');

ewanharris avatar Nov 22 '21 19:11 ewanharris

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

m1ga avatar Nov 22 '21 19:11 m1ga

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 ✔️

jordanbisato avatar Nov 23 '21 21:11 jordanbisato