-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
export const readVersion = contents => { | ||
const marketingVersionString = contents.match(/String PLUGIN_VERSION = "(.*)";/); | ||
const version = marketingVersionString.toString(); | ||
const regexAndroid = /String\sPLUGIN_VERSION\s=\s"(.*)";/g; | ||
|
||
export function readVersion(contents) { | ||
const marketingVersionString = contents.match(regexAndroid); | ||
const version = marketingVersionString | ||
? marketingVersionString[0].replace(regexAndroid, '$1') | ||
: null; | ||
return version; | ||
}; | ||
} | ||
|
||
export const writeVersion = (contents, version) => { | ||
const newContent = contents.replace( | ||
/String PLUGIN_VERSION = ".*";/g, | ||
`String PLUGIN_VERSION = "${version}";` | ||
); | ||
export function writeVersion(contents, version) { | ||
const newContent = contents.replace(regexAndroid, `String PLUGIN_VERSION = "${version}";`); | ||
return newContent; | ||
}; | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
export const readVersion = contents => { | ||
const marketingVersionString = contents.match(/let PLUGIN_VERSION = "(.*)"/); | ||
const version = marketingVersionString.toString(); | ||
const regexIos = /let\sPLUGIN_VERSION:\sString\s=\s"(.*)"/g; | ||
export function readVersion(contents) { | ||
const marketingVersionString = contents.match(regexIos); | ||
const version = marketingVersionString ? marketingVersionString[0].replace(regexIos, '$1') : null; | ||
return version; | ||
}; | ||
} | ||
|
||
export const writeVersion = (contents, version) => { | ||
const newContent = contents.replace( | ||
/let PLUGIN_VERSION = ".*"/g, | ||
`let PLUGIN_VERSION = "${version}"` | ||
); | ||
export function writeVersion(contents, version) { | ||
const newContent = contents.replace(regexIos, `let PLUGIN_VERSION = "${version}"`); | ||
return newContent; | ||
}; | ||
} |