Skip to content

Commit b1ddf6f

Browse files
Revert validation fix (the test was wrong not hte code)
1 parent 2342f93 commit b1ddf6f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

__tests__/api/BundleContent/BundleMocked.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,6 @@ describe("MockedFilesystemTests", () => {
213213
});
214214
it("should detect unwritable nodejsapps directory", () => {
215215
jest.spyOn(fs, "existsSync").mockImplementation((path: string) => {
216-
if (path.endsWith("nodejsapps")) {
217-
return false;
218-
}
219216
if (path.endsWith("cics.xml")) {
220217
return false;
221218
}

src/api/BundleContent/NodejsappBundlePart.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,16 @@ export class NodejsappBundlePart extends BundlePart {
160160
catch (err) {
161161
throw new Error("cics-deploy requires write permission to: " + this.bundleDirectory);
162162
}
163-
// Do we have write permission to the nodejsapp dir?
164-
try {
163+
return;
164+
}
165+
// Do we have write permission to the nodejsapp dir?
166+
try {
165167
BundlePart.fs.accessSync(this.nodejsappsDir, BundlePart.fs.constants.W_OK);
166-
}
167-
catch (err) {
168+
}
169+
catch (err) {
168170
throw new Error("cics-deploy requires write permission to: " + this.nodejsappsDir);
169-
}
170171
}
171172

172-
173173
// Does the .nodejsapp appear to be saveable?
174174
BundlePart.ensureFileSaveable(this.nodejsappFile, this.overwrite);
175175

0 commit comments

Comments
 (0)