Skip to content

Commit

Permalink
handle spaces in filenames when migrating
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 4, 2022
1 parent b901efe commit 1eb4f04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/famous-birds-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte-migrate': patch
---

Correctly rename files with spaces when migrating
2 changes: 1 addition & 1 deletion packages/migrate/migrations/routes/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function error(description, comment_id) {
*/
export function move_file(file, renamed, content, use_git) {
if (use_git) {
execSync(`git mv ${file} ${renamed}`);
execSync(`git mv ${JSON.stringify(file)} ${JSON.stringify(renamed)}`);
} else {
fs.unlinkSync(file);
}
Expand Down

0 comments on commit 1eb4f04

Please sign in to comment.