查看信息

$ fbi ls [item] [item]

item

  • 空: 查看当前目录可用的任务和模板
  • config/configs : 查看FBI全局配置
  • store/stores : 查看模板仓库信息
  • util/utils : 查看可用工具类

例子

$ fbi ls
$ fbi ls util
$ fbi ls store
$ fbi ls config
$ fbi ls config store util

configs 全局配置说明

  • 查看: $ fbi ls config
  • 设置: $ fbi set
  • 使用:ctx.configs
说明 默认值
_DATA_ROOT (只读) 本地仓库目录 /Users/{yourname}/.fbi
_STORE_FILE (只读) 仓库信息文件路径 /Users/{yourname}/.fbi/store.json
_CUSTOM_CONFIG_FILE (只读) 自定义配置文件路径 /Users/{yourname}/.fbi/configs.custom.json
LOG_LEVEL 日志级别 info
LOG_PREFIX 日志前缀 FBI··>
NPM npm别名 npm
NPM_OPTIONS npm参数
TASK_PREFIX 任务模板前缀 fbi-task-
TEMPLATE_PREFIX 项目模板前缀 fbi-project-
TEMPLATE_TASK 模板内任务文件目录名 fbi
TEMPLATE_CONFIG 模板配置文件路径 fbi/options.js
TEMPLATE_INIT_IGNORE 初始化项目时的忽略项 node_modules,.DS_Store,.svn,.git,
dst,dist,package.json,fbi,yarn.lock,
package-lock.json
TEMPLATE_ADD_IGNORE 添加模板时的忽略项 .DS_Store,.svn,.git,dst,dist
VERSION_SEPARATOR 版本分隔符 @

stores 仓库信息说明

  • 查看: $ fbi ls store
  • 使用:ctx.stores
说明 示例
type 模板类型 project/task
path 模板路径 /Users/{yourname}/.fbi/fbi-project-simple
version 模板版本信息 false: 不支持版本控制
{"latest":"v3.1.0","current":"v3.1.0","all":["v3.0.0","v3.1.0"]}
repository 模板来源路径 https://github.com/fbi-templates/fbi-project-mod.git
description 模板描述 Node service, npm module template.
tasks 模板内含任务 build,serve

utils 内置工具类说明

  • 查看: $ fbi ls util
  • 使用:ctx.utils[分类][方法] / ctx.utils[方法]
分类 方法 说明
fs stat,mkdirp,exist,existSync,read,
write,copy,remove,list,isEmptyDir,homeDir
文件操作类
style bold,italic,underline,inverse,white,
grey,black,blue,cyan,green,magenta,red,
yellow,normal
文本样式类
type isJson,isObject,isArray,isTaskFile,
isPath,isGitUrl
类型判断类
git is,clone,pull,tags,currentTag,
currentBranch,checkout,getBranchs
git操作类
path isAbsolute,isRelative,normalize,cwd,join,dir path操作类
Logger debug,info,success,warn,error,log 日志类, 使用方法 :const log = new ctx.utils.Logger(); log.info(‘’)
其他 argvParse 终端参数解析
其他 assign json深合并
其他 dateFormat 日期时间格式化
其他 exec spawn的promise版
其他 flow 终端交互方法
其他 promisify promise化
其他 sequence 顺序执行多个promise

特殊工具类 logger 使用:ctx.logger[方法]

results matching ""

    No results matching ""