Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b21b341 commit e07e51eCopy full SHA for e07e51e
src/create.js
@@ -1,16 +1,23 @@
1
import ncp from 'ncp';
2
import path from 'path';
3
import { promisify } from 'util';
4
+import * as os from 'os';
5
6
const copy = promisify(ncp);
7
8
const copyFiles = async (filePath) => {
9
10
try {
11
12
+ let filePath = new URL(import.meta.url).pathname;
13
+
14
+ if (os.platform() === 'win32') {
15
+ // removes the leading drive letter from the path
16
+ filePath = filePath.substr(3);
17
+ }
18
19
const templateDirectory = path.resolve(
- new URL(import.meta.url).pathname,
- path.join('..', 'templates'),
20
+ filePath, '..', 'templates',
21
);
22
23
const targetDirectory = process.cwd();
0 commit comments