Created
November 17, 2019 04:25
-
-
Save bfollington/6a5b0cd0638ca11b461465dc2e319499 to your computer and use it in GitHub Desktop.
Write package.json version to ProjectSettings.asset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const package = require('./package.json') | |
const projectSettingsPath = 'ProjectSettings/ProjectSettings.asset' | |
const re = /bundleVersion:\s(\d\.\d\.\d)$/gm | |
const fileStr = fs.readFileSync(projectSettingsPath, 'utf8') | |
const updated = fileStr.replace(re, `bundleVersion: ${package.version}`) | |
console.log(`bundleVersion: ${package.version}`) | |
fs.writeFileSync(projectSettingsPath, updated, { encoding: 'utf8' }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment