Git Product home page Git Product logo

injectassets's People

Contributors

arnaudrinquin avatar dvemac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

injectassets's Issues

Support multiple source files

Can this tool support multiple source files and output in place?

E.g.

injectassets -s dist/*.html -d dist -g '*.{css,js}' -o dist

Meaning:

  1. Read all HTML files from dist
  2. Make replacements
  3. Output to dist again (e.g. replace files)

Support multiple source files

Can this tool support multiple source files and output in place?

E.g.

injectassets -s dist/*.html -d dist -g '*.{css,js}' -o dist

Meaning:

  1. Read all HTML files from dist
  2. Make replacements
  3. Output to dist again (e.g. replace files)

The watch example doesn't work in my system

It gives me this log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'inject' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preinject', 'inject', 'postinject' ]
5 info lifecycle [email protected]~preinject: [email protected]
6 silly lifecycle [email protected]~preinject: no script for preinject, continuing
7 info lifecycle [email protected]~inject: [email protected]
8 verbose lifecycle [email protected]~inject: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~inject: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/var/www/html/test-projects/npm-scripts/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux:/usr/local/android-sdk-linux/platform-tools:/home/juanma/.composer/vendor/bin:/var/www/html/test-projects/node-bash:/var/www/html/test-projects/bash-scripts
10 verbose lifecycle [email protected]~inject: CWD: /var/www/html/test-projects/npm-scripts
11 silly lifecycle [email protected]~inject: Args: [ '-c',
11 silly lifecycle   'cat index.html | injectassets -G \'js/*.js;css/*.css\' -w -o index.html' ]
12 silly lifecycle [email protected]~inject: Returned: code: 1  signal: null
13 info lifecycle [email protected]~inject: Failed to exec inject script
14 verbose stack Error: [email protected] inject: `cat index.html | injectassets -G 'js/*.js;css/*.css' -w -o index.html`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at EventEmitter.emit (events.js:173:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at ChildProcess.emit (events.js:173:7)
14 verbose stack     at maybeClose (internal/child_process.js:819:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:212:5)
15 verbose pkgid [email protected]
16 verbose cwd /var/www/html/test-projects/npm-scripts
17 error Linux 3.16.0-59-generic
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "inject"
19 error node v5.2.0
20 error npm  v3.3.12
21 error code ELIFECYCLE
22 error [email protected] inject: `cat index.html | injectassets -G 'js/*.js;css/*.css' -w -o index.html`
22 error Exit status 1
23 error Failed at the [email protected] inject script 'cat index.html | injectassets -G 'js/*.js;css/*.css' -w -o index.html'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the npm-scripts package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     cat index.html | injectassets -G 'js/*.js;css/*.css' -w -o index.html
23 error You can get their info via:
23 error     npm owner ls npm-scripts
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

I'm using Ubuntu 14

source file same as output files does not work

injectassets -s dist/index.html -o dist/index.html -d dist -g '*.{css,js}' results in an empty dist/index.html file.

I am able to cat and pipe the source file to injectassets and everything works as intended, but cat does not work on all OSes.

Publish 1.0.6 on npm

Would be great to have the 1.0.6 version including tags options available on npm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.