-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate-ipa.js
executable file
·28 lines (21 loc) · 1.3 KB
/
create-ipa.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
'use strict'
var program = require('commander')
var exec = require('./lib/exec')
var list = require('./lib/list')
var logger = require('./lib/logger')
program.version(require('./package.json').version)
.description('Create an .ipa file from an .app')
.option('-k, --keychain-name <name>', 'Keychain Name - default APP_NAME', process.env.APP_NAME || 'build-tools')
.option('--ipa <name>', 'Ipa file to create - default build/Release-iphoneos/$APP_NAME.ipa', process.cwd() + '/build/Release-iphoneos/' + (process.env.APP_NAME ? process.env.APP_NAME + '.ipa' : 'app.ipa'))
.option('--app <name>', 'App file to convert - default build/Release-iphoneos/$APP_NAME.app', process.cwd() + '/build/Release-iphoneos/' + (process.env.APP_NAME ? process.env.APP_NAME + '.app' : 'app.app'))
.option('--provisioning-profile <profile>', 'Provisioning profile - default PROVISIONING_PROFILE', list, list(process.env.PROVISIONING_PROFILE))
.parse(process.argv)
var create = function create () {
var embed = program.provisioningProfile.length ? ' -embed "' + program.provisioningProfile + '"' : ''
return exec('xcrun -log -sdk iphoneos PackageApplication "' + program.app + '" -o "' + program.ipa + '" ' + embed)
}
create().catch(function (err) {
logger.error('Error creating ipa', err)
process.exit(1)
})