Skip to content

Commit 0bb75ce

Browse files
committed
feat(alwaysOutOfDate): any truthy value to hard set to 1
1 parent c05ae0a commit 0bb75ce

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/pbxProject.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,8 +1621,10 @@ function pbxShellScriptBuildPhaseObj (obj, options, phaseName) {
16211621
obj.runOnlyForDeploymentPostprocessing = 1;
16221622
}
16231623

1624-
if (options.alwaysOutOfDate !== null) {
1625-
obj.alwaysOutOfDate = options.alwaysOutOfDate;
1624+
// By default, alwaysOutOfDate is not set and treated as false.
1625+
// Any truthy value, it will be set to 1, including any non-empty strings.
1626+
if (options.alwaysOutOfDate) {
1627+
obj.alwaysOutOfDate = 1;
16261628
}
16271629

16281630
return obj;

test/addBuildPhase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('addBuildPhase', () => {
208208
const buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase;
209209
assert.equal(buildPhase.shellPath, '/bin/sh');
210210
assert.equal(buildPhase.shellScript, '"test"');
211-
assert.equal(buildPhase.alwaysOutOfDate, 1);
211+
assert.strictEqual(buildPhase.alwaysOutOfDate, 1);
212212
});
213213

214214
it('should add the PBXBuildPhase without alwaysOutOfDate property', () => {
@@ -217,6 +217,6 @@ describe('addBuildPhase', () => {
217217
const buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase;
218218
assert.equal(buildPhase.shellPath, '/bin/sh');
219219
assert.equal(buildPhase.shellScript, '"test"');
220-
assert.equal(buildPhase.alwaysOutOfDate, null);
220+
assert.strictEqual(buildPhase.alwaysOutOfDate, undefined);
221221
});
222222
});

0 commit comments

Comments
 (0)