zont / copy-and-watch Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I got an error with this command: "filecopy":"copy-and-watch --watch templates/files/media/**/*.{css,js} zzz/dist/"
[WATCH] templates/files/media/**/*.{css,js}
(node:43172) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.relative (path.js:492:5)
at findTarget (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\index.js:40:33)
at FSWatcher.copy (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\index.js:60:14)
at FSWatcher.emit (events.js:400:28)
at FSWatcher.emitWithAll (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\index.js:540:8)
at FSWatcher._emit (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\index.js:632:8)
at listener (E:\wamp64\www\j41rbs5\node_modules\copy-and-watch\node_modules\chokidar\lib\nodefs-handler.js:370:20)
(Use node --trace-warnings ...
to show where the warning was created)
(node:43172) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:43172) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hope you can fix this!
Thanks in advance!
My command:
copy-and-watch --watch src/cms/templates/**/* src/static/**/* dist/site/templates
When the script starts, the first file is copied like this:
[COPY] src/cms/templates/basic-page.php to dist-pw\site\templates\basic-page.php
This is the desired result.
But after the initial copy, when I change this file, the whole structure after src is replicated:
[COPY] src\cms\templates\basic-page.php to dist-pw\site\templates\cms\templates\basic-page.php
Hi, I'm having trouble using --watch
, I'm running this:
npm run watch
with
"watch": "copy-and-watch ./src/public/**/*.{html,css} ./build --watch"
and getting this result when I make a change to src/public/panel.html
and save:
> [email protected] watch /Users/alex/dev/is/r2
> copy-and-watch ./src/public/**/*.{html,css} ./build --watch
[COPY] ./src/public/panel.html to build/panel.html
[COPY] ./src/public/panel.css to build/panel.css
[WATCH] ./src/public/**/*.html
[WATCH] ./src/public/**/*.css
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.relative (path.js:1268:5)
at findTarget (/Users/alex/dev/is/r2/node_modules/copy-and-watch/index.js:37:33)
at FSWatcher.copy (/Users/alex/dev/is/r2/node_modules/copy-and-watch/index.js:57:14)
at emitOne (events.js:115:13)
at FSWatcher.emit (events.js:210:7)
at FSWatcher.<anonymous> (/Users/alex/dev/is/r2/node_modules/chokidar/index.js:196:15)
at FSWatcher._emit (/Users/alex/dev/is/r2/node_modules/chokidar/index.js:238:5)
at FSWatcher.<anonymous> (/Users/alex/dev/is/r2/node_modules/chokidar/lib/fsevents-handler.js:204:14)
at addOrChange (/Users/alex/dev/is/r2/node_modules/chokidar/lib/fsevents-handler.js:210:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch: `copy-and-watch ./src/public/**/*.{html,css} ./build --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alex/.npm/_logs/2018-01-22T04_06_25_666Z-debug.log
Would be nice to add a --exclude pattern
argument to exclude for example .DS_Store
files or folder from the copy/watch
if I do copy-and-watch --watch some/folder/**/* target/
copy-and-watch crashes if I delete some subfolder of some/folder/
. In my opinion this is just a simple change that needs to mirrored.
I'm running this command:
copy-and-watch src/public/**/*.{html,css,jpg,png} build
with this result:
[COPY] src/public/panel.html to build/panel.html
[COPY] src/public/panel.css to build/panel.css
[COPY] src/public/icons/icon128.png to build/icon128.png
[COPY] src/public/icons/icon16.png to build/icon16.png
[COPY] src/public/icons/icon19.png to build/icon19.png
[COPY] src/public/icons/icon48.png to build/icon48.png
I expected the png
files to end up in build/icon
not build
From the small docs, I can see it should copy the files initially, but it doesn't for me. it only does when a file has changes, and one by one. Is this because they are folders, rather than singular files?
copy-and-watch --watch packages/* web/src & copy-and-watch --watch packages/* mobile/src
I am using npm link
for developing dependency alongside main app.
Unfortunately copy-and-watch --watch src/**/*.{html,css,js,svg,png} dist/
does not find files inside a symlink.
Is there any solution to that?
If I do copy-and-watch --watch assets/ dist/
it will copy nothing, while I expect the assets/ folder to be copied. Also if I do copy-and-watch --watch assets/* dist/
It will copy the files inside the assets folder and not itself. Is it possible to copy and watch a directory itself?
I tried to rename a file and got these errors:
(node:20668) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.relative (path.js:437:5)
at findTarget (...\node_modules\copy-and-watch\index.js:40:33)
at FSWatcher.copy (...\node_modules\copy-and-watch\index.js:60:14)
at FSWatcher.emit (events.js:315:20)
at FSWatcher.emitWithAll (...\node_modules\chokidar\index.js:524:8)
at FSWatcher._emit (...\node_modules\chokidar\index.js:616:8)
at NodeFsHandler._handleFile (...\node_modules\chokidar\lib\nodefs-handler.js:400:14)
at NodeFsHandler._addToNodeFs (...\node_modules\chokidar\lib\nodefs-handler.js:628:21)
(node:20668) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20668) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
internal/validators.js:120
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.relative (path.js:437:5)
at findTarget (...\node_modules\copy-and-watch\index.js:40:33)
at FSWatcher.remove (...\node_modules\copy-and-watch\index.js:70:14)
at FSWatcher.emit (events.js:315:20)
at ...\node_modules\chokidar\index.js:565:16
at Map.forEach (<anonymous>)
at Timeout._onTimeout (...\node_modules\chokidar\index.js:564:30)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) {
code: 'ERR_INVALID_ARG_TYPE'
}
Its working fine, except for XML files. For all other files it keeps the relative path from source folder and copies over. But XML in any sub-dir is being copied to root target dir only.
Command used: copy-and-watch --watch /mypath/**/*.{aspx,Master,asax,css,js,png,jpg,xml,gif,otf,eot,ttf,woff} /home/web/targetdir
If i run this command with *.{xml} only it sync the xml files with proper path. But not in combination with other suffixes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.