Skip to content

Commit

Permalink
Fix for husky on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoenigsknecht committed Sep 30, 2024
1 parent 6bf8770 commit b6345f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: 'Setup environment'

env:
IS_CI: true

inputs:
bootstrap-packages:
description: 'Lerna bootstrap packages (comma separated without spaces)'
Expand Down
12 changes: 7 additions & 5 deletions scripts/setup_husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ const fs = require('fs')
const os = require('os')
const path = require('path')

if (process.env.IS_CI) {
return
}

console.log(`Ensuring husky init file(s) are in place`)

const initShFileName = 'init.sh'
const huskyDirPath = path.join(__dirname, '../', '.husky')
const huskyConfigDirPath = path.join(os.homedir(), '/.config/husky/')
const configPath = path.join(os.homedir(), '/.config/')
const huskyConfigDirPath = path.join(configPath, '/husky/')

if (!fs.existsSync(configPath)) {
console.log(`The directory ${configPath} doesn't exist, creating now`)
fs.mkdirSync(configPath)
}

if (!fs.existsSync(huskyConfigDirPath)) {
console.log(`The directory ${huskyConfigDirPath} doesn't exist, creating now`)
Expand Down

0 comments on commit b6345f5

Please sign in to comment.