From 2681eac2ec0239ae136de647862d0ccae40a7f74 Mon Sep 17 00:00:00 2001 From: Vijay Sharma Date: Sun, 10 Nov 2019 14:35:32 -0500 Subject: [PATCH 1/4] Add support for runOnlyForDeploymentPostprocessing --- lib/pbxProject.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 299a7cc..ba89300 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1614,6 +1614,7 @@ function pbxShellScriptBuildPhaseObj (obj, options, phaseName) { obj.outputPaths = options.outputPaths || []; obj.shellPath = options.shellPath; obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"'; + obj.runOnlyForDeploymentPostprocessing = options.runOnlyForDeploymentPostprocessing || 0; return obj; } From 3547f5f9677a682508a45d49ad424bc93d65c719 Mon Sep 17 00:00:00 2001 From: Vijay Sharma Date: Sun, 10 Nov 2019 14:45:00 -0500 Subject: [PATCH 2/4] Add Test for runOnlyForDeploymentPostprocessing --- test/addBuildPhase.js | 6 ++++++ 1 file changed, 6 insertions(+) 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); + }); }); From de3701e8a77fcf2593aa4486243816b917ab44f6 Mon Sep 17 00:00:00 2001 From: Erisu Date: Tue, 16 Jun 2026 20:32:57 +0900 Subject: [PATCH 3/4] fix(runOnlyForDeploymentPostprocessing): only allow 0 or 1, defaulting invalid values to 0 --- lib/pbxProject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index ba89300..0d28241 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1614,7 +1614,7 @@ function pbxShellScriptBuildPhaseObj (obj, options, phaseName) { obj.outputPaths = options.outputPaths || []; obj.shellPath = options.shellPath; obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"'; - obj.runOnlyForDeploymentPostprocessing = options.runOnlyForDeploymentPostprocessing || 0; + obj.runOnlyForDeploymentPostprocessing = options.runOnlyForDeploymentPostprocessing === 1 ? 1 : 0; return obj; } From 057bcf43d76530eeddf69ac99835467765817afd Mon Sep 17 00:00:00 2001 From: Erisu Date: Wed, 17 Jun 2026 14:46:32 +0900 Subject: [PATCH 4/4] fix(runOnlyForDeploymentPostprocessing): remove strict validation --- lib/pbxProject.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 0d28241..41bc398 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -1614,7 +1614,12 @@ function pbxShellScriptBuildPhaseObj (obj, options, phaseName) { obj.outputPaths = options.outputPaths || []; obj.shellPath = options.shellPath; obj.shellScript = '"' + options.shellScript.replace(/"/g, '\\"') + '"'; - obj.runOnlyForDeploymentPostprocessing = options.runOnlyForDeploymentPostprocessing === 1 ? 1 : 0; + + // 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; }