-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprebuild.js
25 lines (22 loc) · 942 Bytes
/
prebuild.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { execSync } from 'child_process'
const platform = process.platform
try {
if (platform === 'win32') {
execSync(
'powershell -Command "(Get-Content .\\node_modules\\.pnpm\\node_modules\\@iconify\\utils\\package.json) | Where-Object {$_ -notmatch \'"\\\\./\\\\*": "\\\\./\\\\*",\' } | Set-Content .\\node_modules\\.pnpm\\node_modules\\@iconify\\utils\\package.json"',
{ stdio: 'inherit' }
)
execSync('powershell -Command Write-Host " win:OK " -ForegroundColor DarkGreen -BackgroundColor White', {
stdio: 'inherit',
})
} else {
execSync('sed -i \'/"\\.\\/\\*": "\\.\\/\\*",/d\' ./node_modules/.pnpm/node_modules/@iconify/utils/package.json', {
stdio: 'inherit',
})
execSync('printf "\\e[32;47m linux/mac:OK \\e[0m"\n', { stdio: 'inherit' })
}
execSync('nuxt prepare', { stdio: 'inherit' })
} catch (error) {
console.error('An error occurred:', error)
process.exit(1)
}