Skip to content

Commit

Permalink
Improved compat
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed May 22, 2022
1 parent 3806c96 commit 0b8df16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/extension/webView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export async function createRepository(context: vscode.ExtensionContext) {
return;
}

const target = `${options.targetFolder}/${options.name}`;
const isWindows = process.platform === 'win32' && !vscode.env.remoteName;
const pathSep = isWindows ? '\\' : '/';
const cmdSep = isWindows ? ' ; ' : ' && ';
const target = `${options.targetFolder}${pathSep}${options.name}`;
const installDependencies = options.nodeModules ? '--install' : '--no-install';
const templateOptions = Object.keys(options.templateOptionsValues).map(
(key) => `--vars.${key}="${options.templateOptionsValues[key]}"`,
Expand Down Expand Up @@ -153,7 +156,7 @@ export async function createRepository(context: vscode.ExtensionContext) {
`cd ${target}`,
`npm version ${options.version} --no-git-tag --allow-same-version`,
'code .',
].join(' && '),
].join(cmdSep),
);
break;
}
Expand All @@ -166,7 +169,8 @@ export async function createRepository(context: vscode.ExtensionContext) {
});

if (localPath) {
wv.webview.postMessage({ command: 'sendLocalPath', data: localPath });
const path = localPath[0].fsPath;
wv.webview.postMessage({ command: 'sendLocalPath', path });
}

break;
Expand Down
2 changes: 1 addition & 1 deletion src/scaffold/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const useStore = create<Store>((set) => {
case 'sendLocalPath':
dispatch(set, (state) => ({
...state,
localPath: message.data[0].path,
localPath: message.path,
}));
break;

Expand Down

0 comments on commit 0b8df16

Please sign in to comment.