GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vue3-cli/index.js at master · itvlog/vue3-cli

Expand file tree

/

index.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
57 lines (55 loc) · 1.55 KB
/

index.js

Copy path

File metadata and controls

executable file
·
57 lines (55 loc) · 1.55 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env node
const {spawn}=require('child_process')
const program = require('commander');
const download = require('git-clone');
const shell = require('shelljs');
const open=require('open')
const clear = require('clear');
const chalk = require('chalk');
program.version('1.0.0', '-v, --version')
let newpj=name=>{
let giturl='[email protected]:vuejs/vue-next-webpack-preview.git'
download(giturl, `./${name}`, function (err) {
shell.rm('-rf', `${name}/.git`);
shell.cd(name)
shell.exec('npm install')
clear();
console.log(chalk.red(`
🏭创建${name}项目!!
cd ${name} 进入项目
vue3-cli start 启动项目
`))
})
//clone(giturl,`./${name}`,null, function() {})
}
let run=()=>{
// shell.exec('npm run dev')
let cp=spawn('npm',['run','dev'])
cp.stdout.pipe(process.stdout)
cp.stderr.pipe(process.stderr)
cp.on('close',()=>{
//clear();
console.log('成功启动')
})
cp.stdout.on("data", data => {
let str=data.toString('utf-8');
let res=str.match(/(http:\/\/localhost:\d{4,5}\/)/ig);
if(res){
let url=res[0]
open(url);
}
});
}
let start=async ()=>{
await open('http://localhost:8080/');
}
program.command('new <name>')
.description('初始化项目')
.action(newpj);
program.command('start')
.description('run project')
.action(run);
program.command('run')
.description('预览项目')
.action(start)
program.parse(process.argv);
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.