mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 05:26:04 +08:00
fix: fix icon generation error on Windows platform (#16254)
This commit is contained in:
parent
6157f57872
commit
40cadab8a6
@ -1,9 +1,10 @@
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { access, appendFile, mkdir, open, readdir, rm, writeFile } from 'node:fs/promises'
|
import { access, appendFile, mkdir, open, readdir, rm, writeFile } from 'node:fs/promises'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
import { parseXml } from '@rgrove/parse-xml'
|
import { parseXml } from '@rgrove/parse-xml'
|
||||||
import { camelCase, template } from 'lodash-es'
|
import { camelCase, template } from 'lodash-es'
|
||||||
|
|
||||||
const __dirname = path.dirname(new URL(import.meta.url).pathname)
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||||||
|
|
||||||
const generateDir = async (currentPath) => {
|
const generateDir = async (currentPath) => {
|
||||||
try {
|
try {
|
||||||
@ -105,7 +106,7 @@ const generateImageComponent = async (entry, pathList) => {
|
|||||||
}
|
}
|
||||||
`.trim())
|
`.trim())
|
||||||
|
|
||||||
await writeFile(path.resolve(currentPath, `${fileName}.module.css`), `${componentCSSRender({ assetPath: path.join('~@/app/components/base/icons/assets', ...pathList.slice(2), entry) })}\n`)
|
await writeFile(path.resolve(currentPath, `${fileName}.module.css`), `${componentCSSRender({ assetPath: path.posix.join('~@/app/components/base/icons/assets', ...pathList.slice(2), entry) })}\n`)
|
||||||
|
|
||||||
const componentRender = template(`
|
const componentRender = template(`
|
||||||
// GENERATE BY script
|
// GENERATE BY script
|
||||||
|
Loading…
x
Reference in New Issue
Block a user