Skip to content

Commit 8db89dc

Browse files
flat-manager: use stdout to get the build id
1 parent 4b6a381 commit 8db89dc

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

flat-manager/dist/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@ const run = (repository, flatManagerUrl, token) => {
1818
LOCAL_REPO_NAME
1919
])
2020
.then(async () => {
21-
const buildId = await exec.exec('flat-manager-client', [
21+
let buildId = ''
22+
const exitCode = await exec.exec('flat-manager-client', [
2223
'--token',
2324
token,
2425
'create',
2526
flatManagerUrl,
2627
repository
27-
])
28+
], {
29+
listeners: {
30+
stdout: (data) => {
31+
buildId += data.toString()
32+
}
33+
}
34+
})
35+
if (exitCode !== 0) {
36+
throw Error('flat-manager-client failed to create a new build')
37+
}
2838
return buildId
2939
})
3040
.then(async (buildId) => {

flat-manager/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@ const run = (repository, flatManagerUrl, token) => {
1111
LOCAL_REPO_NAME
1212
])
1313
.then(async () => {
14-
const buildId = await exec.exec('flat-manager-client', [
14+
let buildId = ''
15+
const exitCode = await exec.exec('flat-manager-client', [
1516
'--token',
1617
token,
1718
'create',
1819
flatManagerUrl,
1920
repository
20-
])
21+
], {
22+
listeners: {
23+
stdout: (data) => {
24+
buildId += data.toString()
25+
}
26+
}
27+
})
28+
if (exitCode !== 0) {
29+
throw Error('flat-manager-client failed to create a new build')
30+
}
2131
return buildId
2232
})
2333
.then(async (buildId) => {

0 commit comments

Comments
 (0)