From accbe7b92cf280a1d15877333b86ba9015643e6a Mon Sep 17 00:00:00 2001 From: indexzero Date: Wed, 29 Jul 2015 22:15:52 -0700 Subject: [PATCH] [fix] Gracefully fail on Windows. --- install.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/install.js b/install.js index 3624b25..5a0480a 100644 --- a/install.js +++ b/install.js @@ -19,6 +19,18 @@ var git = path.resolve(root, '.git') , hooks = path.resolve(git, 'hooks') , precommit = path.resolve(hooks, 'pre-commit'); +// +// Bail out if we are on Windows because the `hook` file only works +// on bash-compatible systems +// +if (process.platform === 'win32') { + console.error('pre-commit:'); + console.error('pre-commit: Refusing to install on Windows.'); + console.error('pre-commit:'); + console.error('pre-commit: The hook was not installed.'); + console.error('pre-commit:'); +} + // // Bail out if we don't have an `.git` directory as the hooks will not get // triggered. If we do have directory create a hooks folder if it doesn't exist.