Skip to content
Browse files

Make pull-libs into a node.js script

  • Loading branch information
1j01 committed Dec 30, 2019
1 parent 12a42cc commit 946ab0cd0ec403fbebb358667e139237c9e142de
Showing with 81 additions and 11 deletions.
  1. +61 −9 package-lock.json
  2. +2 −2 package.json
  3. +18 −0 pull-libs.js

Some generated files are not rendered by default. Learn more.

@@ -35,6 +35,7 @@
"browserfs": "^1.4.3",
"butterchurn": "2.6.7",
"butterchurn-presets": "2.4.7",
"fs-extra": "8.1.0",
"json": "^9.0.6",
"live-server": "^1.2.0",
"recursive-copy": "^2.0.9",
@@ -47,7 +48,6 @@
"make-fs-index @NOTE": "browserfs is currently assumed to be npm linked at around 2.0.0-beta",
"make-fs-index @TODO": "Create a pre-commit hook, or keep this file out of repo, either have it as part of a webserver, or just generated on deploy (in which case it could still be a static site). Ignore gitignored files, including globally gitignored lnk files... altho this is the one repo where lnk files might make sense; I'm sure there's a way to base it off of what things are checked in to git. git ls-files, or git ls-tree, ideally with the contents after staged changes would be applied (is there a 'tree-ish' for that?)",
"update-jspaint": "node src/update-jspaint.js",
"pull-libs @TODO": "# make it into a script so it's not all crammed onto one line in this package.json; include jquery and stuff; maybe even update script tags in html, with CDN URLs, integrity checksums, and fallbacks",
"pull-libs": "cp node_modules/webamp/built/webamp.bundle.js programs/winamp/lib/webamp.bundle.js && cp node_modules/webamp/built/webamp.bundle.min.js programs/winamp/lib/webamp.bundle.min.js && cp node_modules/browserfs/dist/browserfs.js lib/browserfs.js && cp node_modules/browserfs/dist/browserfs.min.js lib/browserfs.min.js && cp node_modules/butterchurn/lib/butterchurn.min.js programs/winamp/lib/butterchurn.min.js && cp node_modules/butterchurn-presets/lib/butterchurnPresets.min.js programs/winamp/lib/butterchurnPresets.min.js"
"pull-libs": "node pull-libs.js"
@@ -0,0 +1,18 @@
// TODO: include jquery and stuff; maybe even update script tags in html, with CDN URLs, integrity checksums, and fallbacks

const {copySync} = require("fs-extra");

const copySyncAndLog = (from, to)=> {
console.log(`Copying ${from} => ${to}`);
copySync(from, to);

copySyncAndLog("node_modules/webamp/built/webamp.bundle.js", "programs/winamp/lib/webamp.bundle.js");
copySyncAndLog("node_modules/webamp/built/webamp.bundle.min.js", "programs/winamp/lib/webamp.bundle.min.js");
copySyncAndLog("node_modules/browserfs/dist/browserfs.js", "lib/browserfs.js");
copySyncAndLog("node_modules/browserfs/dist/browserfs.min.js", "lib/browserfs.min.js");
copySyncAndLog("node_modules/butterchurn/lib/butterchurn.min.js", "programs/winamp/lib/butterchurn.min.js");
copySyncAndLog("node_modules/butterchurn-presets/lib/butterchurnPresets.min.js", "programs/winamp/lib/butterchurnPresets.min.js");
Note: This script doesn't handle updating npm dependencies, just copying scripts into the repo.`);

0 comments on commit 946ab0c

Please sign in to comment.
You can’t perform that action at this time.