最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

这是我的 cli 我想要人们对此发表意见所以如果可以的话请发表意见

网站源码admin31浏览0评论

这是我的 cli 我想要人们对此发表意见所以如果可以的话请发表意见

这是我的 cli 我想要人们对此发表意见所以如果可以的话请发表意见

我想知道你对我的客户有什么看法

#!/usr/bin/env node
import inquirer from 'inquirer';
import * as child from 'node:child_process'

inquirer
  .prompt([
    {
    type:'list',
    message:'what is your project',
    name:'framework',
    choices: ['angular','react','vue','svelte','preact']
    }
  ])
  .then((answers) => {
    if (answers.framework === 'angular'  ){
    child.exec(`git clone .git`)
    console.log("now install the angular cli with")
    console.log("npm i @angular/cli")
    }
    if (answers.framework === 'react'  ){
    child.exec(`git clone .git`)
    console.log("now install react with")
    console.log("npm i react")
    }
    if (answers.framework === 'vue'  ){
    child.exec(`git clone .git`)
    console.log("now install vue with")
    console.log("npm i vue")
    }
    if (answers.framework === 'svelte'  ){
    child.exec(`npm create svelte@latest myapp`)
    console.log("here is the app")
    }
    if (answers.framework === 'preact'  ){
    child.exec(`git clone .git`)
    console.log("now install preact with")
    console.log("npm i preact")
    }  
})

你怎么看?我知道这很愚蠢,所以我将其命名为 stupid projects cli。祝你有美好的一天,随心所欲

回答如下:
发布评论

评论列表(0)

  1. 暂无评论