-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add mobile app release version in Sentry issues #3249
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -46,12 +46,12 @@ module.exports = function (ctx) { | |||||||||
'/node_modules/@capacitor-community/camera-preview/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java', | ||||||||||
}; | ||||||||||
|
||||||||||
// Adding GIT_COMMIT_SHA for sentry | ||||||||||
// Adding mobile app version for tracking the release in sentry | ||||||||||
var mainPath = path.resolve(process.cwd(), 'src/main.ts'); | ||||||||||
var mainPathContent = fs.readFileSync(mainPath).toString(); | ||||||||||
Comment on lines
50
to
51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Listen, my friend! Let's use 'let' or 'const' instead of 'var' Using 'let' or 'const' helps avoid hoisting issues and keeps your code tight and clean. Here's how we can fix it: - var mainPath = path.resolve(process.cwd(), 'src/main.ts');
- var mainPathContent = fs.readFileSync(mainPath).toString();
+ const mainPath = path.resolve(process.cwd(), 'src/main.ts');
+ const mainPathContent = fs.readFileSync(mainPath).toString(); 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome[error] 50-50: Use let or const instead of var. A variable declared with var is accessible in the whole body of the function. Thus, the variable can be accessed before its initialization and outside the block where it is declared. (lint/style/noVar) [error] 51-51: Use let or const instead of var. A variable declared with var is accessible in the whole body of the function. Thus, the variable can be accessed before its initialization and outside the block where it is declared. (lint/style/noVar) |
||||||||||
fs.writeFileSync( | ||||||||||
mainPath, | ||||||||||
mainPathContent.replace(/please-replace-your-git-commit-version/g, process.env.CI_GIT_COMMIT_SHA), | ||||||||||
mainPathContent.replace(/please-replace-your-mobile-app-version/g, ctx.env.FYLE_MOBILE_RELEASE_VERSION), | ||||||||||
'utf8' | ||||||||||
); | ||||||||||
|
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git commit sha wasn't working earlier, check
release
property