Skip to content

Commit

Permalink
[create-dapp] Fix path handling on windows (MystenLabs#15319)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

---------

Co-authored-by: Jason <[email protected]>
  • Loading branch information
hayes-mysten and Wulabalabo authored Dec 12, 2023
1 parent 18c2335 commit f8d44c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-deers-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mysten/create-dapp': patch
---

Fix handling of paths on windows
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions sdk/create-dapp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ async function collectFiles(template: string, dAppName: string) {
async function writeFiles(files: Array<{ path: string; content: Buffer }>, outDir: string) {
for (const file of files) {
const filePath = resolve(outDir, file.path);
const dirPath = filePath.split('/').slice(0, -1).join('/');

const dirPath = resolve(filePath, '..');
if (!existsSync(dirPath)) {
await mkdir(dirPath, { recursive: true });
}
Expand Down

0 comments on commit f8d44c2

Please sign in to comment.