Skip to content

Commit

Permalink
feat: windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuddy committed Oct 18, 2024
1 parent cf40d17 commit 13a726e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/core/manifest/scripts/watch/watch.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/usr/bin/env node

// This script is used to watch for changes from the project root directory where Manifest is installed.
const { spawn } = require('child_process')
const path = require('path')
const os = require('os')
const spawn = require('cross-spawn')

const nodemonPath = path.join(process.cwd(), 'node_modules', '.bin', 'nodemon')
// Determine the appropriate nodemon path
const nodemonExecutable = os.platform() === 'win32' ? 'nodemon.cmd' : 'nodemon'
const nodemonPath = path.join(
process.cwd(),
'node_modules',
'.bin',
nodemonExecutable
)

const nodemon = spawn(
nodemonPath,
['.', '--config', `${__dirname}/nodemon.json`],
{
stdio: 'inherit'
stdio: 'inherit',
shell: true
}
)
nodemon.on('close', (code) => {
Expand Down

0 comments on commit 13a726e

Please sign in to comment.