Skip to content

Commit 8a7f23b

Browse files
committed
fix: Create action.js if it does not exist during build
1 parent 2b066a9 commit 8a7f23b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/cli/build.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ import * as path from "node:path";
44
import { pathToFileURL } from "node:url";
55

66
export async function build(args: string[]) {
7+
const ghatsDir = path.resolve(process.cwd(), "node_modules/.ghats");
8+
const actionJsPath = path.join(ghatsDir, "action.js");
9+
if (!fs.existsSync(actionJsPath)) {
10+
fs.mkdirSync(ghatsDir, { recursive: true });
11+
fs.writeFileSync(actionJsPath, "export {}");
12+
}
13+
714
register("@swc-node/register/esm", pathToFileURL("./"));
815

916
const githubWorkflowsPath = path.resolve(process.cwd(), ".github/workflows");

0 commit comments

Comments
 (0)