diff options
author | Aleksander Machniak <alec@alec.pl> | 2017-06-27 18:34:46 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2017-06-27 18:37:08 +0300 |
commit | 6d53c6b9eb61c8eb797e4e87526e3826e8405de5 (patch) | |
tree | debbdc40fcd3c4fe229cac557c336555171bdcde /bin | |
parent | da63acbd0d2f2afc32a126cda425aacff7441dce (diff) |
Skip js deps installation if there's no jsdeps.json and install-jsdeps.sh
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/installto.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/installto.sh b/bin/installto.sh index 45fc8f0b0..c47a8272a 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -100,13 +100,18 @@ if (strtolower($input) == 'y') { } // check if js-deps are up-to-date - $jsdeps = json_decode(file_get_contents("$target_dir/jsdeps.json")); - $package = $jsdeps->dependencies[0]; - $dest_file = $target_dir . '/' . $package->dest; - if (!file_exists($dest_file) || sha1_file($dest_file) !== $package->sha1) { - echo "Installing JavaScript dependencies..."; - system("cd $target_dir && bin/install-jsdeps.sh"); - echo "done.\n\n"; + if (file_exists("$target_dir/jsdeps.json") && file_exists("$target_dir/bin/install-jsdeps.sh")) { + $jsdeps = json_decode(file_get_contents("$target_dir/jsdeps.json")); + $package = $jsdeps->dependencies[0]; + $dest_file = $target_dir . '/' . $package->dest; + if (!file_exists($dest_file) || sha1_file($dest_file) !== $package->sha1) { + echo "Installing JavaScript dependencies..."; + system("cd $target_dir && bin/install-jsdeps.sh"); + echo "done.\n\n"; + } + } + else { + echo "JavaScript dependencies installation skipped...\n"; } echo "Running update script at target...\n"; |