Socket
Socket
Sign inDemoInstall

watch

Package Overview
Dependencies
3
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.15.0 to 0.16.0

47

cli.js

@@ -8,3 +8,3 @@ #!/usr/bin/env node

if(argv._.length === 0) {
console.error('Usage: watch <command> [directory] [--wait=<seconds>] [--ignoreDotFiles] [--ignoreUnreadable]')
console.error('Usage: watch <command> [...directory] [--wait=<seconds>] [--ignoreDotFiles] [--ignoreUnreadable]')
process.exit()

@@ -15,3 +15,14 @@ }

var command = argv._[0]
var dir = argv._[1] || process.cwd()
var dirs = []
var i
var argLen = argv._.length
if (argLen > 1) {
for(i = 1; i< argLen; i++) {
dirs.push(argv._[i])
}
} else {
dirs.push(process.cwd())
}
var waitTime = Number(argv.wait || argv.w)

@@ -25,17 +36,25 @@

console.error('> Watching', dir)
var wait = false
watch.watchTree(dir, watchTreeOpts, function (f, curr, prev) {
if(wait) return
var dirLen = dirs.length
var skip = dirLen - 1
for(i = 0; i < dirLen; i++) {
var dir = dirs[i]
console.error('> Watching', dir)
watch.watchTree(dir, watchTreeOpts, function (f, curr, prev) {
if(skip) {
skip--
return
}
if(wait) return
execshell(command)
execshell(command)
if(waitTime > 0) {
wait = true
setTimeout(function () {
wait = false
}, waitTime * 1000)
}
})
if(waitTime > 0) {
wait = true
setTimeout(function () {
wait = false
}, waitTime * 1000)
}
})
}

@@ -43,3 +43,3 @@ // Copyright 2010-2011 Mikeal Rogers

if (err) {
if((options.ignoreFileErrors || ['ENOENT', 'EPERM', 'EBUSY']).indexOf(err.code) > -1) {
if (err.code !== 'ENOENT' && (err.code !== 'EPERM' && options.ignoreNotPermitted)) {
return callback(err);

@@ -46,0 +46,0 @@ } else {

@@ -13,3 +13,3 @@ {

},
"version": "0.15.0",
"version": "0.16.0",
"homepage": "https://github.com/mikeal/watch",

@@ -16,0 +16,0 @@ "bugs": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc