-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change "clean" to remove all types of .original files (#117)
This is a little unsafe in that it's more likely to get false positives, but should still be safe since people should be running this within a git repo and because it skips node_modules.
- Loading branch information
1 parent
60194b1
commit 21c4f8c
Showing
7 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { unlink } from 'mz/fs'; | ||
import { basename } from 'path'; | ||
|
||
import getFilesUnderPath from './util/getFilesUnderPath'; | ||
|
||
export default async function clean() { | ||
let filesToDelete = await getFilesUnderPath('.', p => p.endsWith('.original.coffee')); | ||
let filesToDelete = await getFilesUnderPath('.', p => basename(p).includes('.original')); | ||
if (filesToDelete.length === 0) { | ||
console.log('No .original.coffee files were found.'); | ||
console.log('No .original files were found.'); | ||
return; | ||
} | ||
for (let path of filesToDelete) { | ||
console.log(`Deleting ${path}`); | ||
await unlink(path); | ||
} | ||
console.log('Done deleting .original.coffee files.'); | ||
console.log('Done deleting .original files.'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log 'A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Testing | ||
|
||
console.log 'B' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env coffee | ||
|
||
console.log 'C' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters