feat: support dalle image variation

This commit is contained in:
ikechan8370 2023-02-25 15:23:47 +08:00
parent 38de2ce714
commit 5fceef37ec
5 changed files with 127 additions and 6 deletions

View file

@ -2,6 +2,8 @@
// import stripMarkdown from 'strip-markdown'
import { exec } from 'child_process'
import lodash from 'lodash'
import fs from 'node:fs'
import path from 'node:path'
// export function markdownToText (markdown) {
// return remark()
// .use(stripMarkdown)
@ -205,3 +207,14 @@ async function execSync (cmd) {
})
})
}
export function mkdirs (dirname) {
if (fs.existsSync(dirname)) {
return true
} else {
if (mkdirs(path.dirname(dirname))) {
fs.mkdirSync(dirname)
return true
}
}
}