@eljs/create-preset-structure
Version:
Project structure template powered by @eljs/create.
28 lines (22 loc) • 567 B
text/typescript
import { isPathExists } from '@eljs/utils'
import os from 'node:os'
import path from 'node:path'
import { $ } from 'zx'
$.verbose = true
main()
.then(() => process.exit(0))
.catch(error => {
console.error(`prepare error: ${error.message}`)
process.exit(1)
})
async function main(): Promise<void> {
await $`husky`
const huskyPath = path.resolve(__dirname, '../.husky')
const platform = os.platform()
if (
(platform === 'darwin' || platform === 'linux') &&
(await isPathExists(huskyPath))
) {
await $`chmod ug+x .husky/*`
}
}