Skip to content

Commit 4fe77ee

Browse files
WinterYukkytmokmss
andauthored
fix: workingDirectory props was not used (#58)
## Change Description Change to use workingDirectory props. ## Why need this change? Currently, NodejsBuild accept to specification workingDirectory for props. However, the value was not used. ## Possible breaking change Users who have been using `workingDirectory` property might see unexpected behavior after the upgrade. To get back the previous behavior, they can just remove the `workingDirectory` property, because it was not used at all previously. --------- Co-authored-by: Masashi Tomooka <[email protected]>
1 parent b7f5871 commit 4fe77ee

File tree

3 files changed

+471
-6
lines changed

3 files changed

+471
-6
lines changed

src/nodejs-build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,17 @@ curl -i -X PUT -H 'Content-Type:' -d "@payload.json" "$responseURL"
275275
commands: s.commands,
276276
}));
277277

278+
const workingDirectory = props.workingDirectory ?? sources[0].extractPath;
278279
const properties: NodejsBuildResourceProps = {
279280
type: 'NodejsBuild',
280281
sources,
281282
destinationBucketName: props.destinationBucket.bucketName,
282283
destinationKeyPrefix: props.destinationKeyPrefix ?? '/',
283284
distributionId: props.distribution?.distributionId,
284285
assetBucketName: bucket.bucketName,
285-
workingDirectory: sources[0].extractPath,
286+
workingDirectory,
286287
// join paths for CodeBuild (Linux) platform
287-
outputSourceDirectory: posix.join(sources[0].extractPath, props.outputSourceDirectory),
288+
outputSourceDirectory: posix.join(workingDirectory, props.outputSourceDirectory),
288289
environment: props.buildEnvironment,
289290
buildCommands: props.buildCommands ?? ['npm run build'],
290291
codeBuildProjectName: project.projectName,

test/hello.test.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)