Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace rmdir with rm to avoid depreciation warning #6909

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file added CLI_logs.txt
Empty file.
8 changes: 4 additions & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DESCRIPTION
Display help for @vue-storefront/cli.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.16/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.18/src/commands/help.ts)_

## `@vue-storefront/cli init`

Expand All @@ -85,7 +85,7 @@ EXAMPLES
$ @vue-storefront/cli init
```

_See code: [dist/commands/init.ts](https://github.com/vuestorefront/vue-storefront/blob/v3.0.0/dist/commands/init.ts)_
_See code: [dist/commands/init.ts](https://github.com/vuestorefront/vue-storefront/blob/v4.1.1-next.0/dist/commands/init.ts)_

## `@vue-storefront/cli plugins`

Expand All @@ -105,7 +105,7 @@ EXAMPLES
$ @vue-storefront/cli plugins
```

_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.5/src/commands/plugins/index.ts)_
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.7/src/commands/plugins/index.ts)_

## `@vue-storefront/cli plugins:install PLUGIN...`

Expand Down Expand Up @@ -352,5 +352,5 @@ EXAMPLES
$ @vue-storefront/cli update --available
```

_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.4/src/commands/update.ts)_
_See code: [@oclif/plugin-update](https://github.com/oclif/plugin-update/blob/v3.0.6/src/commands/update.ts)_
<!-- commandsstop -->
5 changes: 3 additions & 2 deletions packages/cli/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"success": "🎉 Sucessfully generated your store at \"./{{projectName}}\"!",
"install": "To finish the installation, run the following commands:",
"install_commands": ["cd {{ projectName }}"],
"configure": "Project is conifugred. \nIf you want more advanced configuration go to the \n{{ documentationURL }} to learn how to do it.",
"configure": "Project is configured. \nIf you want more advanced configuration go to \n{{ documentationURL }} to learn how to do it.",
"cd_message": "To start working with the project, cd into project directory:",
"cd_directory": "cd {{ projectName }}",
"start": "Start the project using this command:",
"start_command": "yarn dev",
"canceled": "Store generation cancelled 😞\nWe hope to see you soon! 🤗"
"canceled": "Store generation cancelled 😞\nWe hope to see you soon! 🤗",
"windows_not_supported": "😞 Windows is not supported yet. Please use Linux, WSL or MacOS."
},
"progress": {
"vsf_start": "🧩 Generating Vue Storefront project",
Expand Down
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.1",
"version": "4.1.4",
"description": "Vue Storefront's CLI.",
"bin": "./bin/run",
"homepage": "https://github.com/vuestorefront/vue-storefront",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/src/commands/generate/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ export default class GenerateStore extends Command {
}

if (isInstallMagento) {
if (process.platform === 'win32') {
logSimpleWarningMessage(
t('command.generate_store.message.windows_not_supported')
);
process.exit(0);
}

await checkDocker(writeLog);

const { magentoDirName, magentoAccessKey, magentoSecretKey } =
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.rmdirSync(projectDir, { recursive: true });
await fs.rmSync(projectDir, { recursive: true });
await fs.mkdirSync(projectDir);
sp.stop(
picocolors.green(t('command.generate_store.progress.delete_end'))
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/domains/magento2/docker/removeDocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const removeDockerContainer = async (magentoDirName: string): Promise<any> => {
const removeDocker = spawn('docker-compose', ['rm', '-f'], options);

removeDocker.on('exit', () => {
fs.rmdirSync(magentoDirName, { recursive: true });
fs.rmSync(magentoDirName, { recursive: true });
});
});
};
Expand Down
4 changes: 3 additions & 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,9 @@ const copyEnv = async (vsfDirName: string, magentoDomain?: string) => {
process.exit(1);
}

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

export default copyEnv;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const installDeps = async (
const sp = spinner();

return new Promise((resolve) => {
const install = spawn('yarn', options);
const install =
process.platform === 'win32'
? spawn('yarn.cmd', [], options)
: spawn('yarn', [], options);

sp.start(
picocolors.cyan(t('command.generate_store.progress.install_deps_start'))
Expand Down
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.rmdirSync(magentoDirName, { recursive: true });
await fs.rmSync(magentoDirName, { recursive: true });
await fs.mkdirSync(magentoDirName);
sp.stop(picocolors.green(t('command.generate_store.progress.delete_end')));
newMagentoDirName = magentoDirName;
Expand Down