Skip to content

Commit fe694b8

Browse files
committed
implement bundleAfterXcodeBuild method for sentry
1 parent b24b27d commit fe694b8

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

cli.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,19 @@
148148
}
149149
}
150150
},
151+
"bundleAfterXcodeBuild": {
152+
"description": "bundle after xcode build.",
153+
"options": {
154+
"intermediaDir": {
155+
"default": ".pushy/intermedia/${platform}",
156+
"hasValue": true
157+
},
158+
"output": {
159+
"default": ".pushy/output/${platform}.${time}.ppk",
160+
"hasValue": true
161+
}
162+
}
163+
},
151164
"release": {
152165
"description": "Push builded file to server."
153166
},

src/bundle.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,26 @@ export const commands = {
758758
}
759759
},
760760

761+
bundleAfterXcodeBuild: async function ({ options }) {
762+
const { intermediaDir, output } = translateOptions({
763+
...options,
764+
platform: 'ios',
765+
});
766+
767+
const realOutput = output.replace(/\$\{time\}/g, `${Date.now()}`);
768+
await pack(path.resolve(intermediaDir), realOutput);
769+
770+
const v = await question('是否现在上传此热更包?(Y/N)');
771+
if (v.toLowerCase() === 'y') {
772+
await this.publish({
773+
args: [realOutput],
774+
options: {
775+
platform: 'ios',
776+
},
777+
});
778+
}
779+
},
780+
761781
async diff({ args, options }) {
762782
const { origin, next, realOutput } = diffArgsCheck(args, options, 'diff');
763783

0 commit comments

Comments
 (0)