-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The built files don't mimic the same file structure as the source. So running `path` with `../..` was targeting a different folder depending in the environment.
- Loading branch information
Showing
3 changed files
with
9 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import * as fs from 'fs-extra' | ||
import * as path from 'path' | ||
import templateFolder from '../template-folder' | ||
|
||
export default function copyTemplate(name: string): void { | ||
fs.copySync(path.join(__dirname, '..', '..', 'templates', name), `./${name}`) | ||
fs.copySync(templateFolder(name), `${process.cwd()}/${name}`) | ||
} |
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,5 @@ | ||
import * as path from 'path' | ||
|
||
export default function templateFolder(file: string): string { | ||
return path.join(__dirname, '..', 'templates', file) | ||
} |