我编写了一个Nodejs脚本,该脚本查找了最后更改/修改的文件名。
因此,我正在使用findCLI命令。我有一个隐藏文件.change以将其他文件与该文件进行比较(修改时间)。
这是下面的代码:
const es6dir = 'es6';
const path2dir = './htdocs/';
const exec = require("child_process").exec;
exec(`find ${path2dir + es6dir}/ -type f -newer .change`, (error, stdout) => {
if(error){
console.log(`Error: ${error}`);
return;
}
console.log(stdout);
//update .change modified timestamp
exec('touch -c .change');
}
如果我在Git Bash中运行此命令,一切都会很好,但是如果我使用Windows终端,它将显示一个错误的命令。
有没有一种简单的方法可以同时在Linux和Windows终端上使用?
我想在两个平台上都运行此命令,因为一些团队成员正在Linux上工作,而其他团队成员正在使用Windows机器。
拉莫斯之舞
相关分类