Skip to content

Commit 9541c1c

Browse files
committed
semistandard
1 parent d146873 commit 9541c1c

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Applesign {
5050
async getDeviceProvision () {
5151
const installedProvisions = await tools.ideviceprovision('list');
5252
const pd = path.join(homedir(), 'Library', 'MobileDevice', 'Provisioning Profiles');
53-
for (let ip of installedProvisions) {
53+
for (const ip of installedProvisions) {
5454
const absPath = path.join(pd, ip + '.mobileprovision');
5555
if (fs.existsSync(absPath)) {
5656
return absPath;
@@ -344,11 +344,11 @@ class Applesign {
344344
this.emit('message', 'Using an unsigned provisioning');
345345
const newEntitlementsFile = file + '.entitlements';
346346
const newEntitlements = plistBuild(entMacho).toString();
347-
const tmpEmtitlementsFile = this._pathInTmp(newEntitlementsFile);
348-
fs.writeFileSync(tmpEmtitlementsFile, newEntitlements);
349-
this.config.entitlement = tmpEmtitlementsFile;
347+
const tmpEntitlementsFile = this._pathInTmp(newEntitlementsFile);
348+
fs.writeFileSync(tmpEntitlementsFile, newEntitlements);
349+
this.config.entitlement = tmpEntitlementsFile;
350350
if (!this.config.noEntitlementsFile) {
351-
fs.writeFileSync(newEntitlementsFile, tmpEntitlements);
351+
fs.writeFileSync(newEntitlementsFile, tmpEntitlementsFile);
352352
}
353353
this.debugInfo(file, 'newEntitlements', plist.parse(newEntitlements));
354354
return;
@@ -701,10 +701,10 @@ class Applesign {
701701
if (this.config.all) {
702702
libraries.push(...ls.orphanedLibraries());
703703
} else {
704-
for (let ol of ls.orphanedLibraries()) {
704+
for (const ol of ls.orphanedLibraries()) {
705705
console.error('Warning: Orphaned library not signed, try -a: ' + ol);
706706
}
707-
 }
707+
}
708708
this.debugInfo('analysis', 'orphan', ls.orphanedLibraries());
709709
// const libraries = ls.diskLibraries ();
710710
libs = libraries.filter(library => !(ls.appexs.includes(library))); // remove already-signed appexs

lib/config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ function parse (argv) {
221221
'P', 'parallel',
222222
'S', 'self-signed-provision',
223223
'V', 'verify-twice',
224-
'Z', 'pseudo-sign'
224+
'Z', 'pseudo-sign',
225225
'a', 'all',
226226
'c', 'clone-entitlements',
227227
'f', 'force-family',
@@ -235,7 +235,7 @@ function parse (argv) {
235235
'v', 'verify',
236236
'w', 'without-watchapp',
237237
'x', 'without-xctests',
238-
'z', 'ignore-zip-errors',
238+
'z', 'ignore-zip-errors'
239239
]
240240
});
241241
}
@@ -292,6 +292,6 @@ module.exports = {
292292
fromOptions: fromOptions,
293293
fromState: fromState,
294294
helpMessage: helpMessage,
295-
parse: parse
296-
shortHelpMessage: shortHelpMessage,
295+
parse: parse,
296+
shortHelpMessage: shortHelpMessage
297297
};

lib/tools.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ function getTool (tool) {
9595
}
9696

9797
async function ideviceprovision (action, optarg) {
98-
switch (action) {
99-
case 'list':
98+
if (action === 'list') {
10099
const res = await execProgram(getTool('ideviceprovision'), ['list'], null);
101100
return res.stdout.split('\n')
102101
.filter((line) => line.indexOf('-') !== -1)
103102
.map((line) => line.split(' ')[0]);
103+
} else {
104+
throw new Error('unsupported ideviceprovision action');
104105
}
105106
}
106107

@@ -119,7 +120,7 @@ async function codesign (identity, entitlement, keychain, file) {
119120
if (typeof keychain === 'string') {
120121
args.push('--keychain=' + keychain);
121122
}
122-
args.push('--generate-entitlement-der')
123+
args.push('--generate-entitlement-der');
123124
args.push(file);
124125
return execProgram(getTool('codesign'), args, null);
125126
}

0 commit comments

Comments
 (0)