0.9.2 • Published 4 years ago
bonree-injector v0.9.2
bonree-injector
A injector to import base agent automatically
how to use
npx bonree-injector -h
// or
npm install -g bonree-injector
bonree-injector -h
Usage:
bonree-injector [options]
options
target
Type: String
Alias: t
Default: ./**/*.html
Target files match pattern.
file
Type: String
Alias: f
Path to agent. It is required if agent was injected as code block.
link
Type: String
Alias: l
If is specified a value, a script link will be inject instead of code block. Use this value as src attribute.
backup
Type: boolean
Alias: b
Default: true
Backup target files before injection.
backupDir
Type: String
Default: ./backup
Directory of backup files.
dist
Type: String
Alias: d
Default: ./dist
Directory of output files.
Examples
bonree-injector -t 'src/**/*.{html,jsp}' -f ./agent.min.js
bonree-injector -t 'test/scripts/**/*.{html,jsp,ftl}' --backupDir test/backup -f ./agent.min.js -d test/dist
before:
after:
bonree-injector -l /agent.min.js
在windows环境使用git-bash,如果链接地址以/开头,需要在开头多添加一个/,以上述命令为例,地址应为//agent.min.js,否则将指向本地系统路径
before:
after: