Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite07e51e

Browse files
committed
Removes drive path if on windows
1 parentb21b341 commite07e51e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/create.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
importncpfrom'ncp';
22
importpathfrom'path';
33
import{promisify}from'util';
4+
import*asosfrom'os';
45

56
constcopy=promisify(ncp);
67

78
constcopyFiles=async(filePath)=>{
89

910
try{
1011

12+
letfilePath=newURL(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+
1119
consttemplateDirectory=path.resolve(
12-
newURL(import.meta.url).pathname,
13-
path.join('..','templates'),
20+
filePath,'..','templates',
1421
);
1522

1623
consttargetDirectory=process.cwd();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp