# ct_cli **Repository Path**: lanbos_document/ct_cli ## Basic Information - **Project Name**: ct_cli - **Description**: 基于fis3和npm script的前端项目脚手架 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: pc - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-08-23 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ct_cli 基于fis3和npm script的前端项目脚手架 ## 环境 * macOS && (bash||zsh) * node 6 && npm * [fis3](https://fex.baidu.com/fis3/) 全局安装fis3,执行时若提示需安装插件按照提示安装,当前使用插件 ```shell ├── fis-parser-less@0.1.3 ├── fis3@3.4.33 ├── fis3-hook-relative@2.0.0 ├── fis3-parser-typescript@1.1.4 ├── fis3-preprocessor-autoprefixer@0.1.1 ``` * python3 绑定`python3`命令到环境变量,py脚本没有太过复杂,应该可用py2降级使用,更改npm script中的对应命令即可,随后等fis3支持node8将会移除python脚本完全使用node ## 使用 1. 下载脚手架 ```shell # pc 脚手架 git clone -b pc https://git.oschina.net/lanbos_document/ct_cli.git # wap 脚手架 git clone -b wap https://git.oschina.net/lanbos_document/ct_cli.git ``` 随后切换到`ct_cli`目录进行操作 ```shell cd ./ct_cli ``` 2. 绑定到新项目的github地址 首先在github或者其他git代码托管仓库新建项目(最好生成一个不含README的空项目),记录项目地址然后切换到 ```shell npm run init ${yourGitHubPath} ``` 这个脚本只是执行了git命令链接到新的git地址,并新增dev分支,随后即可正常使用git功能 3. 开发 ```shell npm run dev ``` 4. 打包 ```shell npm run prod ``` ## 其他 ### 连接到远程仓库,并将代码同步到远程仓库 ```bash git remote add origin yourPath git push -u origin master ``` ### git删除分支 ```bash git branch -D testing ``` ```bash git push origin ${localBranchName}:master ``` ### 用Python获取命令行输出 ```py import os command = 'ping www.baidu.com ' #可以直接在命令行中执行的命令 r = os.popen(command) #执行该命令 info = r.readlines() #读取命令行的输出到一个list print(info) ``` ### fis3 常用命令 ```shell sudo fis3 server start -p 15080 sudo fis3 server clean sudo fis3 release -wL sudo fis3 server stop sudo fis3 release prod -d ../outputM ```