diff --git a/README.md b/README.md index 2978080..5de2485 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ Building `surfingkeys-conf` requires a few dependencies to be installed: 4. __Gulp Build/Install__ ```shell - $ gulp install # OR "gulp build" to build to ./build/.surfingkeys without installing + $ ./node_modules/.bin/gulp install # OR "./node_modules/.bin/gulp build" to build to ./build/.surfingkeys without installing ``` This will build the final configuration file and place it at `~/.surfingkeys`. @@ -260,14 +260,14 @@ Building `surfingkeys-conf` requires a few dependencies to be installed: - __Linux__: `file:///home/{USERNAME}/.surfingkeys` (replace `{USERNAME}` with your username) - __macOS__: `file:///Users/{USERNAME}/.surfingkeys` (replace `{USERNAME}` with your username) - __Windows__: `file://%Homedrive%%Homepath%/.surfingkeys` (This is a guess, please correct me if I'm wrong) - - __IV.__ Hack Away! If you ever make a change to any of your configuration files in the future, simply run `gulp install` again and your new configuration will automatically be loaded by SurfingKeys. + - __IV.__ Hack Away! If you ever make a change to any of your configuration files in the future, simply run `./node_modules/.bin/gulp install` again and your new configuration will automatically be loaded by SurfingKeys.
Option B: Manually copy/paste into the SurfingKeys configuration form - - __I.__ Copy the contents of `./build/.surfingkeys` (or `$HOME/.surfingkeys` if you ran `gulp install`) + - __I.__ Copy the contents of `./build/.surfingkeys` (or `$HOME/.surfingkeys` if you ran `./node_modules/.bin/gulp install`) - __II.__ Open the SurfingKeys [configuration page](chrome-extension://mffcegbjcdejldmihkogmcnkgbbhioid/pages/options.html) diff --git a/README.tmpl.md b/README.tmpl.md index b70567b..95ea9d6 100644 --- a/README.tmpl.md +++ b/README.tmpl.md @@ -93,7 +93,7 @@ Building `surfingkeys-conf` requires a few dependencies to be installed: 4. __Gulp Build/Install__ ```shell - $ gulp install # OR "gulp build" to build to ./build/.surfingkeys without installing + $ ./node_modules/.bin/gulp install # OR "./node_modules/.bin/gulp build" to build to ./build/.surfingkeys without installing ``` This will build the final configuration file and place it at `~/.surfingkeys`. @@ -115,14 +115,14 @@ Building `surfingkeys-conf` requires a few dependencies to be installed: - __Linux__: `file:///home/{USERNAME}/.surfingkeys` (replace `{USERNAME}` with your username) - __macOS__: `file:///Users/{USERNAME}/.surfingkeys` (replace `{USERNAME}` with your username) - __Windows__: `file://%Homedrive%%Homepath%/.surfingkeys` (This is a guess, please correct me if I'm wrong) - - __IV.__ Hack Away! If you ever make a change to any of your configuration files in the future, simply run `gulp install` again and your new configuration will automatically be loaded by SurfingKeys. + - __IV.__ Hack Away! If you ever make a change to any of your configuration files in the future, simply run `./node_modules/.bin/gulp install` again and your new configuration will automatically be loaded by SurfingKeys.
Option B: Manually copy/paste into the SurfingKeys configuration form - - __I.__ Copy the contents of `./build/.surfingkeys` (or `$HOME/.surfingkeys` if you ran `gulp install`) + - __I.__ Copy the contents of `./build/.surfingkeys` (or `$HOME/.surfingkeys` if you ran `./node_modules/.bin/gulp install`) - __II.__ Open the SurfingKeys [configuration page](chrome-extension://mffcegbjcdejldmihkogmcnkgbbhioid/pages/options.html) diff --git a/gulpfile.js b/gulpfile.js index 662bef7..1725f9c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -37,7 +37,7 @@ gulp.task("gulp-autoreload", () => { let p const spawnChildren = function spawnChildren() { if (p) p.kill() - p = spawn("gulp", ["lint-gulpfile", "install", "watch-nogulpfile"], { stdio: "inherit" }) + p = spawn("./node_modules/.bin/gulp", ["lint-gulpfile", "install", "watch-nogulpfile"], { stdio: "inherit" }) } gulp.watch("gulpfile.js", spawnChildren) spawnChildren() @@ -57,7 +57,7 @@ gulp.task("lint", () => .pipe(eslint()) .pipe(eslint.format())) -gulp.task("check-priv", () => { +gulp.task("check-priv", (done) => { try { fs.statSync("./conf.priv.js") } catch (e) { @@ -65,24 +65,8 @@ gulp.task("check-priv", () => { console.log("Creating ./conf.priv.js based on ./conf.priv.example.js") fs.copyFileSync("./conf.priv.example.js", "./conf.priv.js", fs.constants.COPYFILE_EXCL) } -}) - -gulp.task("build", ["check-priv", "clean", "lint", "readme"], () => gulp.src(paths.entry, { read: false }) - .pipe(parcel()) - .pipe(rename(".surfingkeys")) - .pipe(gulp.dest("build"))) - -gulp.task("install", ["build"], () => gulp.src("build/.surfingkeys") - .pipe(gulp.dest(os.homedir()))) - -gulp.task("watch", () => { - gulp.watch([].concat(paths.scripts, paths.gulpfile), ["readme", "install"]) - gulp.watch(paths.readme, ["readme"]) -}) -gulp.task("watch-nogulpfile", () => { - gulp.watch([].concat(paths.scripts), ["readme", "install"]) - gulp.watch(paths.readme, ["readme"]) + done() }) gulp.task("readme", () => { @@ -154,4 +138,26 @@ gulp.task("readme", () => { .pipe(gulp.dest(".")) }) -gulp.task("default", ["build"]) +gulp.task("build", gulp.series("check-priv", "clean", "lint", "readme"), (done) => { + gulp.src(paths.entry, { read: false }) + .pipe(parcel()) + .pipe(rename(".surfingkeys")) + .pipe(gulp.dest("build")) + + done() +}) + +gulp.task("install", gulp.series("build"), () => gulp.src("build/.surfingkeys") + .pipe(gulp.dest(os.homedir()))) + +gulp.task("watch", () => { + gulp.watch([].concat(paths.scripts, paths.gulpfile), gulp.series("readme", "install")) + gulp.watch(paths.readme, gulp.series("readme")) +}) + +gulp.task("watch-nogulpfile", () => { + gulp.watch([].concat(paths.scripts), gulp.series("readme", "install")) + gulp.watch(paths.readme, gulp.series("readme")) +}) + +gulp.task("default", gulp.series("build"))