diff --git a/bin/install-jsdeps.sh b/bin/install-jsdeps.sh index c39f5bb8a..7a27aeecd 100755 --- a/bin/install-jsdeps.sh +++ b/bin/install-jsdeps.sh @@ -213,8 +213,12 @@ function extract_zipfile($package, $srcfile) $extract = $CACHEDIR . '/' . $package['lib'] . '-extract'; exec(sprintf('%s -o %s -d %s', $UNZIP, escapeshellarg($srcfile), $extract), $out, $retval); + // get the root folder of the extracted package + $extract_tree = glob("$extract/*", GLOB_ONLYDIR); + $sourcedir = $extract_tree[0]; + foreach ($package['map'] as $src => $dest) { - echo "Installing files $extract/$src into $destdir/$dest\n"; + echo "Installing files $sourcedir/$src into $destdir/$dest\n"; // make sure the destination's parent directory exists if (strpos($dest, '/') !== false) { @@ -225,11 +229,11 @@ function extract_zipfile($package, $srcfile) } // avoid copying source directory as a child into destination - if (is_dir($extract . '/' . $src) && is_dir($destdir . '/' . $dest)) { + if (is_dir($sourcedir . '/' . $src) && is_dir($destdir . '/' . $dest)) { exec(sprintf('rm -rf %s/%s', $destdir, $dest)); } - exec(sprintf('mv -f %s/%s %s/%s', $extract, $src, $destdir, $dest), $out, $retval); + exec(sprintf('mv -f %s/%s %s/%s', $sourcedir, $src, $destdir, $dest), $out, $retval); if ($retval !== 0) { echo "ERROR: Failed to move $src into $destdir/$dest; " . join('; ' . $out) . "\n"; } diff --git a/jsdeps.json b/jsdeps.json index f3581577a..3fc9f68f1 100644 --- a/jsdeps.json +++ b/jsdeps.json @@ -43,7 +43,7 @@ "copyright": "Copyright (c) 1999-2015 Ephox Corp. All rights reserved", "rm": "program/js/tinymce", "map": { - "tinymce/js/tinymce": "tinymce" + "js/tinymce": "tinymce" }, "omit": [ "tinymce/license.txt", @@ -78,9 +78,9 @@ "sha1": "3b767c2e3acd6796e54ed19ed2ac0755fcf87984", "license": "MIT", "map": { - "*/lib": "lib", - "*/addon/selection": "addon/selection", - "*/mode/sieve": "mode/sieve" + "lib": "lib", + "addon/selection": "addon/selection", + "mode/sieve": "mode/sieve" } } ]