Skip to content

Commit

Permalink
fix(ci): 在 generatedPages 目标文件夹不存在时自动创建
Browse files Browse the repository at this point in the history
  • Loading branch information
ISNing committed Aug 8, 2024
1 parent 5b3d2da commit f0a72be
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import gulp from "gulp";
import fs from "fs";
import { generateColorGradient } from "./gulphelper.js";
import { exec } from "child_process";
import { mkdirp } from 'mkdirp'

const generateLaptopRecommendationPages = (sourcePath, json) => {
let markdown = "";
Expand Down Expand Up @@ -181,6 +182,7 @@ gulp.task("generate-laptop-recommendation-pages", () => {
const jsonData = JSON.parse(data);
const markdownContent = generateLaptopRecommendationPages(jsonFilePath, jsonData);

mkdirp.sync(markdownFilePath.substring(0, markdownFilePath.lastIndexOf("/")));
fs.writeFile(markdownFilePath, markdownContent, (err) => {
if (err) {
reject(err);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"@tsconfig/node20": "^20.1.4",
"@vue/tsconfig": "^0.5.1",
"gulp": "^5.0.0",
"mkdirp": "^3.0.1",
"playwright-chromium": "^1.45.3"
}
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0a72be

Please sign in to comment.