From 660cf9c1e3efc6b50be473b03a55b61fed032de9 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Wed, 18 Mar 2020 20:04:14 +0200 Subject: [PATCH 01/16] Add .npmignore --- .npmignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..b43ed4d --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +.env +yarn.lock From dccb7512f8560e3ec065e19f8528e9d34d668a0e Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Wed, 18 Mar 2020 20:16:36 +0200 Subject: [PATCH 02/16] Poll once immediately Otherwise errors will be delayed --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d6eff11..d16bf61 100755 --- a/index.js +++ b/index.js @@ -41,7 +41,7 @@ const convertRecentEventDatesToDelta = () => { }, {}); }; -setInterval(async () => { +const poll = async () => { const { events, seenIds } = await fetchNewEvents(state.seenIds); const hooks = await collectHooks(); const monitoredFolders = new Set(hooks.map(x => x.folder)); @@ -80,4 +80,7 @@ setInterval(async () => { }); state.seenIds = seenIds; -}, 30000); +}; + +setInterval(poll, 30000); +poll(); From 7a2ee30791b2a9dcad866cad3956eccabe2abca9 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Wed, 18 Mar 2020 20:31:54 +0200 Subject: [PATCH 03/16] Update readme --- README.md | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5c506f6..5c49d4f 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,55 @@ # syncthing-hooks -Very early experiment for running event hooks when SyncThing detects changes in a folder. +Run shell scripts via event hook files (similar to Git hooks) when changes are detected in a [Syncthing](https://syncthing.net/) folder. ## Prerequisites -A somewhat recent version of Node.js. +[Node.js >= 10](https://nodejs.org/en/) ## Installation -None yet, there's no point installing this as a daemon right now. But you'll need to install the dependencies to make it run: - ```sh -npm i -# or -yarn +npm i -g syncthing-hooks ``` ## Usage -You can experiment with it by just running it via Node.js and monitoring the output. +You can simply run the watcher process via: ```sh -API_KEY=mykey node index.js +API_KEY=mykey syncthing-hooks ``` -Then change some files in one of your monitored folders. +Don't forget to substitute `mykey` with your syncthing API key, which can be found in the settings in the GUI. + +It won't install itself as a daemon by default, however. In order to run it as a service, it is recommended to install [pm2](https://pm2.keymetrics.io/): + +```sh +npm i -g pm2 +``` + +You can then register it as a daemon via: + +```sh +pm2 start "API_KEY=mykey syncthing-hooks" --name sthooks +``` + +To create the daemon automatically on startup, consult [this documentation](https://pm2.keymetrics.io/docs/usage/startup/). + +You can follow the output of your hooks by using: + +```sh +pm2 logs +``` + +## Hooks + +Create a folder in your home directory called `.syncthing-hooks`. Each hook is a file with the following naming scheme: + +`folder-name-delay` + +The folder name is the 11 character unique string found in the syncthing GUI. The delay is a string (anything parseable by the [ms module](https://github.com/zeit/ms)) indicating the idle time after an event, so that hooks aren't executed multiple times on successive changes in a short interval. + +An example: a script at the location `~/.syncthing-hooks/night-owlzz-5m` will be executed five minutes after the most recent event in the folder with the identifier `night-owlzz`. + +Make sure your folder identifier is exactly 11 characters long and does not have an extension. Also, don't forget to `chmod +x` the script. From fcdb7a4ad324a64a32329098cc3c176563939de3 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Wed, 18 Mar 2020 20:32:03 +0200 Subject: [PATCH 04/16] 0.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f34f66..bb138fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "syncthing-hooks", - "version": "0.1.0", + "version": "0.2.0", "main": "index.js", "bin": { "syncthing-hooks": "index.js" From 21711b960cdd537ac96b1120b60a19c565542a5d Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Wed, 18 Mar 2020 20:51:21 +0200 Subject: [PATCH 05/16] Hide scheduling message when running hook --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d16bf61..2614597 100755 --- a/index.js +++ b/index.js @@ -53,7 +53,6 @@ const poll = async () => { .filter(x => deltaForFolders[x.folder]) .forEach(hook => { const timeToWait = hook.time - deltaForFolders[hook.folder]; - console.log(`scheduled hook "${hook.path}" to run in ${timeToWait}ms`); if (timeToWait < 0) { const existingPromise = state.promisesForHooks[hook.path]; if (existingPromise) { @@ -76,6 +75,8 @@ const poll = async () => { delete state.promisesForHooks[hook.path]; }); } + } else { + console.log(`scheduled hook "${hook.path}" to run in ${timeToWait}ms`); } }); From d13b5933d03168b0f0b9b0221f50684d2eae7b5e Mon Sep 17 00:00:00 2001 From: bus Date: Sun, 18 Apr 2021 01:41:41 +0200 Subject: [PATCH 06/16] function to read from env --- api.js | 3 ++- env.js | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 env.js diff --git a/api.js b/api.js index 7caf844..17df1ac 100644 --- a/api.js +++ b/api.js @@ -1,9 +1,10 @@ const got = require('got'); +const { getEnvVar } = require('./env.js'); const fetchEvents = () => got('http://localhost:8384/rest/events', { headers: { - 'X-API-Key': process.env.API_KEY, + 'X-API-Key': getEnvVar('API_KEY','invalid') }, }).json(); diff --git a/env.js b/env.js new file mode 100644 index 0000000..8999dd4 --- /dev/null +++ b/env.js @@ -0,0 +1,9 @@ +module.exports = { + getEnvVar: function (varname, defaultvalue){ + var result = process.env[varname]; + if(result!=undefined) + return result; + else + return defaultvalue; + } +}; From b60f0b759a58af065e9521fc014d33d969965e49 Mon Sep 17 00:00:00 2001 From: bus Date: Sun, 18 Apr 2021 01:42:48 +0200 Subject: [PATCH 07/16] URL from env --- api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.js b/api.js index 17df1ac..5219d25 100644 --- a/api.js +++ b/api.js @@ -2,7 +2,7 @@ const got = require('got'); const { getEnvVar } = require('./env.js'); const fetchEvents = () => - got('http://localhost:8384/rest/events', { + got(getEnvVar('ST_URL','http://localhost:8384/rest/events'), { headers: { 'X-API-Key': getEnvVar('API_KEY','invalid') }, From 36ff52ae5b77f44a6e77de1bffe54995bd1fec70 Mon Sep 17 00:00:00 2001 From: bus Date: Fri, 30 Apr 2021 00:39:34 +0200 Subject: [PATCH 08/16] hook root from env --- hooks.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks.js b/hooks.js index 512d6c2..085f74f 100644 --- a/hooks.js +++ b/hooks.js @@ -3,8 +3,9 @@ const ms = require('ms'); const os = require('os'); const path = require('path'); const { spawn } = require('child_process'); +const { getEnvVar } = require('./env.js'); -const getHooksRoot = () => path.join(os.homedir(), '/.syncthing-hooks'); +const getHooksRoot = () => getEnvVar('ST_HOOK_DIR', path.join(os.homedir(), '/.syncthing-hooks')) const readHooksRoot = async root => { try { From a32ca79e022eb717a1393ce9b60a1b8722588cf6 Mon Sep 17 00:00:00 2001 From: bus Date: Fri, 30 Apr 2021 00:57:38 +0200 Subject: [PATCH 09/16] renamed env var --- hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks.js b/hooks.js index 085f74f..bd5fb42 100644 --- a/hooks.js +++ b/hooks.js @@ -5,7 +5,7 @@ const path = require('path'); const { spawn } = require('child_process'); const { getEnvVar } = require('./env.js'); -const getHooksRoot = () => getEnvVar('ST_HOOK_DIR', path.join(os.homedir(), '/.syncthing-hooks')) +const getHooksRoot = () => getEnvVar('ST_HOOK_ROOT', path.join(os.homedir(), '/.syncthing-hooks')) const readHooksRoot = async root => { try { From f96da3e2b4521ac054cdd7784ce7070b1d745713 Mon Sep 17 00:00:00 2001 From: bus Date: Fri, 30 Apr 2021 00:58:21 +0200 Subject: [PATCH 10/16] explanation for new env vars --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c49d4f..a2a289e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,13 @@ API_KEY=mykey syncthing-hooks Don't forget to substitute `mykey` with your syncthing API key, which can be found in the settings in the GUI. +If Syncthing runs on another host or listens to a non-default port, you can specify an URL by using `ST_URL`. +Note that this URL has to include the protocol, hostname, port and path, e.g.: + +``` +ST_URL=http://:8384/rest/events +``` + It won't install itself as a daemon by default, however. In order to run it as a service, it is recommended to install [pm2](https://pm2.keymetrics.io/): ```sh @@ -44,7 +51,9 @@ pm2 logs ## Hooks -Create a folder in your home directory called `.syncthing-hooks`. Each hook is a file with the following naming scheme: +Create a folder in your home directory called `.syncthing-hooks`. +A different directory can be set using `ST_HOOK_ROOT`. +Each hook is a file with the following naming scheme: `folder-name-delay` From 841a75288bbc6a10c5933fd53be50c5048ae9596 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Mon, 10 May 2021 16:19:43 +0300 Subject: [PATCH 11/16] Update dependencies --- package.json | 2 +- yarn.lock | 69 ++++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index bb138fb..d7396c9 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,6 @@ "dependencies": { "dotenv": "8.2.0", "got": "10.6.0", - "ms": "2.1.2" + "ms": "2.1.3" } } diff --git a/yarn.lock b/yarn.lock index 0b4a9df..a27fbe2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@sindresorhus/is@^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-2.1.0.tgz#6ad4ca610f696098e92954ab431ff83bea0ce13f" - integrity sha512-lXKXfypKo644k4Da4yXkPCrwcvn6SlUW2X2zFbuflKHNjf0w9htru01bo26uMhleMXsDmnZ12eJLdrAZa9MANg== + version "2.1.1" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-2.1.1.tgz#ceff6a28a5b4867c2dd4a1ba513de278ccbe8bb1" + integrity sha512-/aPsuoj/1Dw/kzhkgz+ES6TxG0zfTMGLwuK2ZG00k/iJzYHTLCE8mVU8EPqEOp/lmxPoq1C1C9RYToRKb2KEfg== "@szmarczak/http-timer@^4.0.0": version "4.0.5" @@ -29,7 +29,7 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== -"@types/keyv@*": +"@types/keyv@*", "@types/keyv@^3.1.1": version "3.1.1" resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== @@ -37,9 +37,9 @@ "@types/node" "*" "@types/node@*": - version "13.9.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.1.tgz#96f606f8cd67fb018847d9b61e93997dabdefc72" - integrity sha512-E6M6N0blf/jiZx8Q3nb0vNaswQeEyn0XlupO+xN6DtJ6r6IT4nXrTry7zhIfYvFCl3/8Cu6WIysmUBKiqV0bqQ== + version "15.0.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67" + integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA== "@types/responselike@*": version "1.0.0" @@ -49,10 +49,11 @@ "@types/node" "*" cacheable-lookup@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-2.0.0.tgz#33b1e56f17507f5cf9bb46075112d65473fb7713" - integrity sha512-s2piO6LvA7xnL1AR03wuEdSx3BZT3tIJpZ56/lcJwzO/6DTJZlTs7X3lrvPxk6d1PlDe6PrVe2TjlUIZNFglAQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-2.0.1.tgz#87be64a18b925234875e10a9bb1ebca4adce6b38" + integrity sha512-EMMbsiOTcdngM/K6gV/OxF2x0t07+vMOWxZNSCRQMjO2MY2nhZQ6OYhOOpyQrbhqsgtvKGI7hcq6xjnA92USjg== dependencies: + "@types/keyv" "^3.1.1" keyv "^4.0.0" cacheable-request@^7.0.1: @@ -83,9 +84,9 @@ decompress-response@^5.0.0: mimic-response "^2.0.0" defer-to-connect@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.0.tgz#83d6b199db041593ac84d781b5222308ccf4c2c1" - integrity sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg== + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== dotenv@8.2.0: version "8.2.0" @@ -105,9 +106,9 @@ end-of-stream@^1.1.0: once "^1.4.0" get-stream@^5.0.0, get-stream@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== dependencies: pump "^3.0.0" @@ -143,9 +144,9 @@ json-buffer@3.0.1: integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== keyv@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.0.tgz#2d1dab694926b2d427e4c74804a10850be44c12f" - integrity sha512-U7ioE8AimvRVLfw4LffyOIRhL2xVgmE8T22L6i0BucSnBUyv4w+I7VN/zVZwRKHOI6ZRUcdMdWHQ8KSUvGpEog== + version "4.0.3" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" + integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== dependencies: json-buffer "3.0.1" @@ -164,10 +165,10 @@ mimic-response@^2.0.0, mimic-response@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== normalize-url@^4.1.0: version "4.5.0" @@ -182,26 +183,26 @@ once@^1.3.1, once@^1.4.0: wrappy "1" p-cancelable@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" - integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== p-event@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.1.0.tgz#e92bb866d7e8e5b732293b1c8269d38e9982bf8e" - integrity sha512-4vAd06GCsgflX4wHN1JqrMzBh/8QZ4j+rzp0cd2scXRwuBEv+QR3wrVA5aLhWDLw4y2WgDKvzWF3CCLmVM1UgA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" + integrity sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ== dependencies: - p-timeout "^2.0.1" + p-timeout "^3.1.0" p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-timeout@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-2.0.1.tgz#d8dd1979595d2dc0139e1fe46b8b646cb3cdf038" - integrity sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA== +p-timeout@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" + integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== dependencies: p-finally "^1.0.0" From ee3029486fd9a3e87b0a7c67268f0fa16a08eeab Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Mon, 10 May 2021 16:20:12 +0300 Subject: [PATCH 12/16] 0.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d7396c9..eedd6dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "syncthing-hooks", - "version": "0.2.0", + "version": "0.3.0", "main": "index.js", "bin": { "syncthing-hooks": "index.js" From fdb40117df690e9331589d11cdebb1cd7554cfb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Jun 2021 02:04:26 +0000 Subject: [PATCH 13/16] Bump normalize-url from 4.5.0 to 4.5.1 Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1. - [Release notes](https://github.com/sindresorhus/normalize-url/releases) - [Commits](https://github.com/sindresorhus/normalize-url/commits) --- updated-dependencies: - dependency-name: normalize-url dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a27fbe2..c356364 100644 --- a/yarn.lock +++ b/yarn.lock @@ -171,9 +171,9 @@ ms@2.1.3: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== normalize-url@^4.1.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" - integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== once@^1.3.1, once@^1.4.0: version "1.4.0" From bf2b3539acf6c0fc88c42113a172d0b534fc8f21 Mon Sep 17 00:00:00 2001 From: Oliver Evans Date: Fri, 5 Nov 2021 00:37:25 -0700 Subject: [PATCH 14/16] Remove 11-character requirement on folder names. Fixes #1. --- hooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks.js b/hooks.js index bd5fb42..19c0531 100644 --- a/hooks.js +++ b/hooks.js @@ -21,7 +21,7 @@ const parseHooks = (root, hooks) => hooks .map(x => ({ path: path.join(root, x), - match: x.match(/(?.{11})-(?