Skip to content

Commit

Permalink
Merge pull request #6908 from vuestorefront/fix/yarn-version-checker
Browse files Browse the repository at this point in the history
fix: yarn version checker for windows fixed
  • Loading branch information
skirianov committed Apr 25, 2023
2 parents 9bdc22e + b1300bd commit dc4572d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-storefront/cli",
"version": "4.1.0",
"version": "4.1.1",
"description": "Vue Storefront's CLI.",
"bin": "./bin/run",
"homepage": "https://github.com/vuestorefront/vue-storefront",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const handleProjectDiretoryExists = async ({
sp.start(
picocolors.cyan(t('command.generate_store.progress.delete_start'))
);
await fs.rmSync(projectDir, { recursive: true, force: true });
await fs.rmdirSync(projectDir, { recursive: true });
await fs.mkdirSync(projectDir);
sp.stop(
picocolors.green(t('command.generate_store.progress.delete_end'))
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/src/domains/magento2/functions/checkYarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const checkYarnVersion = (yarnString: string): boolean => {
const checkYarn = async (
writeLog: (message: string) => void
): Promise<void> => {
const yarn = spawn('yarn', ['-v']);
const yarn =
process.platform === 'win32'
? spawn('yarn.cmd', ['--version'])
: spawn('yarn', ['--version']);

yarn.stdout.on('data', (data) => {
if (!checkYarnVersion(data.toString())) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/domains/magento2/functions/copyEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const copyEnv = async (vsfDirName: string, magentoDomain?: string) => {
process.exit(1);
}

fs.rmSync(path.join(vsfDirName, '.env.example'));
fs.rmdirSync(path.join(vsfDirName, '.env.example'));
};

export default copyEnv;
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const confirmOverwrite = async ({
sp.start(
picocolors.cyan(t('command.generate_store.progress.delete_start'))
);
await fs.rmSync(magentoDirName, { recursive: true, force: true });
await fs.rmdirSync(magentoDirName, { recursive: true });
await fs.mkdirSync(magentoDirName);
sp.stop(picocolors.green(t('command.generate_store.progress.delete_end')));
newMagentoDirName = magentoDirName;
Expand Down

0 comments on commit dc4572d

Please sign in to comment.