shell - 如何在 Gulp 4 中运行 shell 脚本(.sh 文件)?
问题描述
大家好,新年快乐!
从 Gulp 版本 4 开始,我无法运行 shell 脚本。
我有简单的 shell 脚本。
if application id "com.adobe.estoolkit-4.0" is running then
display dialog "Close The App!" buttons {"OK"} default button 1
end if
当我以这种方式运行它时,它可以工作
const { exec } = require('child_process');
function checkAppisOpen() {
return exec('./utils/check.sh');
};
exports.run = checkAppisOpen;
但是当我尝试使用 npm gulp-shell 插件时,它不会工作。
错误:您是否忘记发出异步完成信号?
见代码:
const shell = require('gulp-shell');
function checkAppisOpen() {
return shell('./utils/check.sh');
};
exports.run = checkAppisOpen;
我知道我做错了什么。请有人解释一下这个异步完成是如何在幕后工作的。或者至少在我可以读到它的地方。因为似乎 gulp 文档对我来说还不够https://gulpjs.com/docs/en/getting-started/async-completion
解决方案
推荐阅读
- python - OpenCV Watermark保持纵横比不给出相同的输入/输出结果
- html - CSS如何使这个div居中
- excel - Excel 对 Index - match 和 sumifs 组合的帮助?
- sql-server - 如何使用spring框架将LDAP数据添加到关系数据库表中的查询数据中
- java - 未知格式转换异常运行时错误
- css - CSS 悬停 2 图标
- python - 如何将文件目录作为方法参数传递?
- arrays - 指针数组和二维数组之间的区别
- blogger - 是什么<
我正在尝试做一个小的自定义来更改 blogspot.com 上博客中的 Open Graph 图像。
当我查看模板 Html 源时,它包含大量(>4,000 行)代码,使用
<b:xxx ...>
. 这个b
标签语言是什么用的?我在哪里可以找到有关它的更多信息? - java - 检查字符串的所有字符是否包含相同的次数