This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-node-xcode.git
The following commit(s) were added to refs/heads/master by this push:
new 9d908c4 feat: add support for runOnlyForDeploymentPostprocessing
(#172)
9d908c4 is described below
commit 9d908c441c2df9864688753f8f1726ada050de66
Author: エリス <[email protected]>
AuthorDate: Thu Jun 18 02:31:49 2026 +0900
feat: add support for runOnlyForDeploymentPostprocessing (#172)
* Add support for runOnlyForDeploymentPostprocessing
* Add Test for runOnlyForDeploymentPostprocessing
* fix(runOnlyForDeploymentPostprocessing): only allow 0 or 1, defaulting
invalid values to 0
* fix(runOnlyForDeploymentPostprocessing): any truthy value, it will be set
to 1, including any non-empty strings
---------
Co-authored-by: Vijay Sharma <[email protected]>
---
lib/pbxProject.js | 6 ++++++
test/addBuildPhase.js | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index 299a7cc..41bc398 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -1615,6 +1615,12 @@ function pbxShellScriptBuildPhaseObj (obj, options,
phaseName) {
obj.shellPath = options.shellPath;
obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"';
+ // By default, runOnlyForDeploymentPostprocessing is set to 0.
+ // Any truthy value, it will be set to 1, including any non-empty strings.
+ if (options.runOnlyForDeploymentPostprocessing) {
+ obj.runOnlyForDeploymentPostprocessing = 1;
+ }
+
return obj;
}
diff --git a/test/addBuildPhase.js b/test/addBuildPhase.js
index f653f09..d3249b9 100644
--- a/test/addBuildPhase.js
+++ b/test/addBuildPhase.js
@@ -191,4 +191,10 @@ describe('addBuildPhase', () => {
assert.equal(buildPhase.shellPath, '/bin/sh');
assert.equal(buildPhase.shellScript, '"echo \\"hello world!\\""');
});
+
+ it('should add runOnlyForDeploymentPostprocessing option to run scripts',
() => {
+ const options = { shellPath: '/bin/sh', shellScript: 'echo "hello
world!"', runOnlyForDeploymentPostprocessing: 1 };
+ const buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase',
'Run a script', proj.getFirstTarget().uuid, options).buildPhase;
+ assert.equal(buildPhase.runOnlyForDeploymentPostprocessing, 1);
+ });
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]