Skip to content

Commit c08a51a

Browse files
committed
funconou !
1 parent 134ef43 commit c08a51a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/extension.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode';
22
import { promisify } from 'util';
3-
import { spawn, spawnSync } from 'child_process';
3+
import { spawnSync } from 'child_process';
44
import * as path from 'path';
55
import * as fs from 'fs';
66

@@ -49,11 +49,10 @@ function isNpmInstalled(): boolean {
4949
}
5050
}
5151

52-
async function installVueCLI(): Promise<boolean> {
52+
async function installVueCLI(): Promise<boolean> {
5353
try {
54-
vscode.window.showInformationMessage('Vue sendo instalado caralho');
55-
await exec('npm init -y');
56-
await exec('npm install vue@latest');
54+
vscode.window.showInformationMessage('Vue CLI is being installed.');
55+
await exec('npm install -g @vue/cli');
5756
vscode.window.showInformationMessage('Vue CLI has been installed successfully.');
5857
return true;
5958
} catch (error: any) {
@@ -66,8 +65,8 @@ async function createVueProject(projectFolderName: string): Promise<boolean> {
6665
const projectFolderPath = path.join(vscode.workspace.rootPath || '', projectFolderName);
6766

6867
try {
69-
fs.mkdirSync(projectFolderPath);
70-
await exec(`vue create ${projectFolderName}`, { cwd: vscode.workspace.rootPath });
68+
vscode.window.showInformationMessage('Creating Vue.js project...');
69+
await exec(`vue create --preset default ${projectFolderName}`, { cwd: vscode.workspace.rootPath });
7170
return true;
7271
} catch (error: any) {
7372
vscode.window.showErrorMessage('Error creating the Vue.js project: ' + error.message);

0 commit comments

Comments
 (0)