shell | 执行 shell 命令 | import gulp from "gulp";
import readPkg from "@jswork/read-pkg-json";
import { exec } from "child_process";
gulp.task("compress", () => {
const pkg = readPkg();
const distName = `${pkg.name}-${pkg.version}.tar.gz`;
return exec(`cd dist && tar -czf ${distName} *`);
});
gulp.task("default", gulp.series("compress"));
|