Comparing version 0.7.3 to 0.7.4
@@ -39,3 +39,3 @@ #!/usr/bin/env node | ||
var full = currentDir; | ||
log.info('或者你可以全局路劲使用hlink, 路劲为', chalk.cyan(path.resolve(full, '../../../../bin/hlink'))); | ||
log.info('或者你可以全局路径使用hlink, 路径为', chalk.cyan(path.resolve(full, '../../../../bin/hlink'))); | ||
} | ||
@@ -42,0 +42,0 @@ } |
@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { saveCache } from '../../config/cacheHelp.js'; | ||
import ProgressBar from '../../progress.js'; | ||
import ProgressBar, { SimpleProgressBar } from '../../progress.js'; | ||
var green = '\u001b[42m \u001b[0m'; | ||
@@ -87,3 +87,3 @@ var red = '\u001b[47m \u001b[0m'; | ||
c = 0; | ||
bar_1 = new ProgressBar("\n ".concat(chalk.green('● hlink'), " :bar :percent :etas ").concat(chalk.gray(':current/:total'), " \n :file \n \n"), { | ||
bar_1 = process.stdout.isTTY ? new ProgressBar("\n ".concat(chalk.green('● hlink'), " :bar :percent :etas ").concat(chalk.gray(':current/:total'), " \n :file \n \n"), { | ||
complete: green, | ||
@@ -93,3 +93,3 @@ incomplete: red, | ||
clear: true | ||
}); | ||
}) : new SimpleProgressBar(waitLinkFiles.length); | ||
i = 0, len = waitLinkFiles.length / count; | ||
@@ -96,0 +96,0 @@ _a.label = 2; |
@@ -58,6 +58,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (source) { | ||
warning(!path.isAbsolute(source), '配置文件', chalk.cyan(configPath), '源地址必须指定绝对路劲'); | ||
warning(!path.isAbsolute(source), '配置文件', chalk.cyan(configPath), '源地址必须指定绝对路径'); | ||
} | ||
if (dest) { | ||
warning(!path.isAbsolute(dest), '配置文件', chalk.cyan(configPath), '目标必须指定绝对路劲'); | ||
warning(!path.isAbsolute(dest), '配置文件', chalk.cyan(configPath), '目标必须指定绝对路径'); | ||
} | ||
@@ -64,0 +64,0 @@ return [2 /*return*/, { |
import chalk from 'chalk'; | ||
export default "\nQQ\u53CD\u9988\u7FA4\u53F7\uFF1A".concat(chalk.cyanBright('807101297'), "\n\n\u7528\u6CD5:\n hlink prune /path/to/source1,/path/to/source2 /path/to/dest1,/path/to/dest2\n\n\u8BF4\u660E:\n \u8BE6\u7EC6\u8BF4\u660E\u89C1 https://github.com/likun7981/hlink/blob/master/docs/prune.md\n\n\u6CE8\u610F:\n \u56E0\u4E3A\u6211\u4EEC\u91C7\u7528 ").concat(chalk.cyan(',(英文逗号)'), " \u6765\u8FDB\u884C\u591A\u9879\u8F93\u5165\u3002\n \u6240\u4EE5\u4F60\u7684\u8DEF\u52B2\u4E00\u5B9A\u4E0D\u8981\u5305\u542B ").concat(chalk.cyan(',(英文逗号)'), "\u3002\n \u5426\u5219\u4F1A\u5BFC\u81F4\u672A\u77E5\u9519\u8BEF\uFF0C\u540E\u679C\u81EA\u8D1F~\n\n\u7528\u6CD5:\n ").concat(chalk.gray('# 修剪多余硬链文件'), "\n $ hlink prune sourceDir1,sourceDir2 destDir1,destDir2\n ").concat(chalk.gray('# 修剪多余硬链并删除所在目录'), "\n $ hlink prune -p sourceDir1,sourceDir2 destDir1,destDir2\n ").concat(chalk.gray('# 修剪时无需确认,一般使用于计划任务'), "\n $ hlink prune -w sourceDir1,sourceDir2 destDir1,destDir2\n\n\u53EF\u914D\u7F6E\u9009\u9879:\n --pruneDir,-p \u662F\u5426\u5220\u9664\u786C\u94FE\u6587\u4EF6\u53CA\u6240\u5728\u76EE\u5F55\u3002\n \u5982\u679C\u7ED9\u4E86\u8FD9\u4E2A\u9009\u9879\u5219\u4F1A \u5426\u5219\u53EA\u4F1A\u5220\u9664 \u786C\u94FE\u6587\u4EF6\n\n --withoutConfirm,-w \u5220\u9664\u524D\u662F\u5426\u9700\u786E\u8BA4? \u9ED8\u8BA4\u9700\u8981\u786E\u8BA4\u3002\n \u5982\u679C\u4F60\u4F7F\u7528\u8BA1\u5212\u4EFB\u52A1\uFF0C\u5EFA\u8BAE\u8BBE\u7F6E\u4E3A\u65E0\u9700\u786E\u8BA4\n --includeExtname,i \u68C0\u6D4B\u5305\u542B\u7684\u540E\u7F00\u540D\uFF0C\u540Chlink --help\u4E2D\u7684includeExtname\u4E00\u6837\n --excludeExtname,e \u68C0\u6D4B\u6392\u9664\u7684\u540E\u7F00\u540D\uFF0C\u540Chlink --help\u4E2D\u7684excludeExtname\u4E00\u6837\n"); | ||
export default "\nQQ\u53CD\u9988\u7FA4\u53F7\uFF1A".concat(chalk.cyanBright('807101297'), "\n\n\u7528\u6CD5:\n hlink prune /path/to/source1,/path/to/source2 /path/to/dest1,/path/to/dest2\n\n\u8BF4\u660E:\n \u8BE6\u7EC6\u8BF4\u660E\u89C1 https://github.com/likun7981/hlink/blob/master/docs/prune.md\n\n\u6CE8\u610F:\n \u56E0\u4E3A\u6211\u4EEC\u91C7\u7528 ").concat(chalk.cyan(',(英文逗号)'), " \u6765\u8FDB\u884C\u591A\u9879\u8F93\u5165\u3002\n \u6240\u4EE5\u4F60\u7684\u8DEF\u5F84\u4E00\u5B9A\u4E0D\u8981\u5305\u542B ").concat(chalk.cyan(',(英文逗号)'), "\u3002\n \u5426\u5219\u4F1A\u5BFC\u81F4\u672A\u77E5\u9519\u8BEF\uFF0C\u540E\u679C\u81EA\u8D1F~\n\n\u7528\u6CD5:\n ").concat(chalk.gray('# 修剪多余硬链文件'), "\n $ hlink prune sourceDir1,sourceDir2 destDir1,destDir2\n ").concat(chalk.gray('# 修剪多余硬链并删除所在目录'), "\n $ hlink prune -p sourceDir1,sourceDir2 destDir1,destDir2\n ").concat(chalk.gray('# 修剪时无需确认,一般使用于计划任务'), "\n $ hlink prune -w sourceDir1,sourceDir2 destDir1,destDir2\n\n\u53EF\u914D\u7F6E\u9009\u9879:\n --pruneDir,-p \u662F\u5426\u5220\u9664\u786C\u94FE\u6587\u4EF6\u53CA\u6240\u5728\u76EE\u5F55\u3002\n \u5982\u679C\u7ED9\u4E86\u8FD9\u4E2A\u9009\u9879\u5219\u4F1A \u5426\u5219\u53EA\u4F1A\u5220\u9664 \u786C\u94FE\u6587\u4EF6\n\n --withoutConfirm,-w \u5220\u9664\u524D\u662F\u5426\u9700\u786E\u8BA4? \u9ED8\u8BA4\u9700\u8981\u786E\u8BA4\u3002\n \u5982\u679C\u4F60\u4F7F\u7528\u8BA1\u5212\u4EFB\u52A1\uFF0C\u5EFA\u8BAE\u8BBE\u7F6E\u4E3A\u65E0\u9700\u786E\u8BA4\n --includeExtname,i \u68C0\u6D4B\u5305\u542B\u7684\u540E\u7F00\u540D\uFF0C\u540Chlink --help\u4E2D\u7684includeExtname\u4E00\u6837\n --excludeExtname,e \u68C0\u6D4B\u6392\u9664\u7684\u540E\u7F00\u540D\uFF0C\u540Chlink --help\u4E2D\u7684excludeExtname\u4E00\u6837\n"); |
@@ -114,3 +114,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
log.info("\u5171\u8BA1\u627E\u5230 ".concat(chalk.cyan(pathsNeedDelete.length), " \u4E2A\u8DEF\u52B2\u9700\u8981\u5220\u9664\uFF0C\u5217\u8868\u5982\u4E0B")); | ||
log.info("\u5171\u8BA1\u627E\u5230 ".concat(chalk.cyan(pathsNeedDelete.length), " \u4E2A\u8DEF\u5F84\u9700\u8981\u5220\u9664\uFF0C\u5217\u8868\u5982\u4E0B")); | ||
pathsNeedDelete.forEach(function (file) { | ||
@@ -117,0 +117,0 @@ console.log('', chalk.gray(file)); |
import ansiEscapes from 'ansi-escapes'; | ||
import wrapAnsi from 'wrap-ansi'; | ||
import { log } from './utils.js'; | ||
var ProgressBar = /** @class */ (function () { | ||
@@ -153,2 +154,16 @@ function ProgressBar(fmt, options) { | ||
}()); | ||
var SimpleProgressBar = /** @class */ (function () { | ||
function SimpleProgressBar(total) { | ||
var _this = this; | ||
this.tick = function (count) { | ||
_this.current += count; | ||
log.info("\u6267\u884C\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6".concat(_this.current, "/").concat(_this.total)); | ||
}; | ||
log.info('如果你看到这个消息,说明你的bash不支持格式化输入'); | ||
this.total = total; | ||
this.current = 0; | ||
} | ||
return SimpleProgressBar; | ||
}()); | ||
export { SimpleProgressBar }; | ||
export default ProgressBar; |
@@ -243,3 +243,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
* | ||
* @param _paths 路劲集合 | ||
* @param _paths 路径集合 | ||
* @returns 返回_paths的公共父目录 | ||
@@ -256,3 +256,3 @@ * | ||
/** | ||
* 排序,把最短的路劲排到最前面 | ||
* 排序,把最短的路径排到最前面 | ||
*/ | ||
@@ -262,3 +262,3 @@ paths = paths.sort(function (a, b) { return a.split(path.sep).length - b.split(path.sep).length; }); | ||
var dirname = path.join(path.dirname(firstItem), '/'); | ||
// 如果paths里面每个都包含了最短路劲,说明最短路劲就算所有路劲的目录了 | ||
// 如果paths里面每个都包含了最短路径,说明最短路径就算所有路径的目录了 | ||
while (!paths.every(function (p) { return p.includes(dirname); })) { | ||
@@ -265,0 +265,0 @@ dirname = path.join(path.dirname(dirname), '/'); |
{ | ||
"name": "hlink", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "hlink", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91160
1833