@algocare/react-native-code-push 11.0.2 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/createPullRequestReleaseCommand/addToPullRequestRelease.js +0 -1
- package/cli/commands/createPullRequestReleaseCommand/createPullRequestRelease.js +2 -0
- package/cli/commands/createPullRequestReleaseCommand/index.js +3 -1
- package/cli/commands/getPackageHashCommand/index.js +44 -0
- package/cli/index.js +5 -0
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ program
|
|
|
48
48
|
const { bundleUploader, setReleaseHistory, getReleaseHistory } =
|
|
49
49
|
await findAndReadConfigFile(process.cwd(), options.config)
|
|
50
50
|
|
|
51
|
-
await createPullRequestRelease(
|
|
51
|
+
const bundleFileName = await createPullRequestRelease(
|
|
52
52
|
bundleUploader,
|
|
53
53
|
setReleaseHistory,
|
|
54
54
|
getReleaseHistory,
|
|
@@ -65,4 +65,6 @@ program
|
|
|
65
65
|
options.skipCleanup,
|
|
66
66
|
options.outputBundleDir
|
|
67
67
|
)
|
|
68
|
+
|
|
69
|
+
process.stdout.write(bundleFileName)
|
|
68
70
|
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const { program } = require('commander')
|
|
2
|
+
const { findAndReadConfigFile } = require('../../utils/fsUtils')
|
|
3
|
+
const { COMPILED_CONFIG_FILE_NAME } = require('../../constant')
|
|
4
|
+
|
|
5
|
+
program
|
|
6
|
+
.command('get-package-hash')
|
|
7
|
+
.description(
|
|
8
|
+
'Retrieves and prints the package hash of a specific binary version.\n`getReleaseHistory` function should be implemented in the config file.'
|
|
9
|
+
)
|
|
10
|
+
.option('-a, --app <string>', 'target app (user/device)')
|
|
11
|
+
.option('-p, --platform <string>', 'target platform (ios/android)')
|
|
12
|
+
.option('-b, --binary-version <string>', 'target binary version (x.y.z)')
|
|
13
|
+
.option('-r, --pr-number <number>', 'pull request number')
|
|
14
|
+
.option(
|
|
15
|
+
'-c, --config <path>',
|
|
16
|
+
'configuration file name (JS/TS)',
|
|
17
|
+
COMPILED_CONFIG_FILE_NAME
|
|
18
|
+
)
|
|
19
|
+
.action(async (options) => {
|
|
20
|
+
const { getReleaseHistory } = await findAndReadConfigFile(
|
|
21
|
+
process.cwd(),
|
|
22
|
+
options.config
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const releaseHistory = await getReleaseHistory(
|
|
26
|
+
options.app,
|
|
27
|
+
options.binaryVersion,
|
|
28
|
+
options.platform
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
const filteredReleaseHistory = Object.entries(releaseHistory)
|
|
32
|
+
.filter(([key]) => key.includes(options.prNumber))
|
|
33
|
+
.reduce((acc, [key, value]) => {
|
|
34
|
+
acc[key] = value
|
|
35
|
+
return acc
|
|
36
|
+
}, {})
|
|
37
|
+
|
|
38
|
+
console.log(JSON.stringify(filteredReleaseHistory, null, 2))
|
|
39
|
+
|
|
40
|
+
const latestReleaseVersion = Object.keys(filteredReleaseHistory).at(-1)
|
|
41
|
+
process.stdout.write(
|
|
42
|
+
filteredReleaseHistory[latestReleaseVersion].packageHash
|
|
43
|
+
)
|
|
44
|
+
})
|
package/cli/index.js
CHANGED