[Pkg-javascript-commits] [pdf.js] 278/414: Use the correct path when checking if a `/l10n` directory exists, to avoid errors during `gulp importl10n` (PR 7063 followup)

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 41e5fa3c7a80daa08da71549836249282c9fed49
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Mar 20 18:37:02 2016 +0100

    Use the correct path when checking if a `/l10n` directory exists, to avoid errors during `gulp importl10n` (PR 7063 followup)
    
    This is regression from PR 7063, causing `gulp importl10n` to fail:
    ```
    $ gulp importl10n
    [19:45:02] Using gulpfile c:\Users\Jonas\Git\pdfjs\gulpfile.js
    [19:45:02] Starting 'importl10n'...
    
    Downloading ach...
    [19:45:02] 'importl10n' errored after 4.42 ms
    [19:45:02] Error: EEXIST, file already exists 'c:\Users\Jonas\Git\pdfjs\l10n\ach
    '
        at Error (native)
        at Object.fs.mkdirSync (fs.js:747:18)
        at downloadLanguageFiles (c:\Users\Jonas\Git\pdfjs\external\importL10n\local
    es.js:59:8)
        at next (c:\Users\Jonas\Git\pdfjs\external\importL10n\locales.js:90:5)
        at Object.downloadL10n (c:\Users\Jonas\Git\pdfjs\external\importL10n\locales
    .js:91:5)
        at Gulp.<anonymous> (c:\Users\Jonas\Git\pdfjs\gulpfile.js:92:11)
        at module.exports (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\node_modules\o
    rchestrator\lib\runTask.js:34:7)
        at Gulp.Orchestrator._runTask (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\no
    de_modules\orchestrator\index.js:273:3)
        at Gulp.Orchestrator._runStep (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\no
    de_modules\orchestrator\index.js:214:10)
        at Gulp.Orchestrator.start (c:\Users\Jonas\Git\pdfjs\node_modules\gulp\node_
    modules\orchestrator\index.js:134:8)
    ```
---
 external/importL10n/locales.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js
index b8a590d..089209c 100644
--- a/external/importL10n/locales.js
+++ b/external/importL10n/locales.js
@@ -55,13 +55,14 @@ function downloadLanguageFiles(root, langCode, callback) {
   var files = ['chrome.properties', 'viewer.properties'];
   var downloadsLeft = files.length;
 
-  if (!fs.existsSync(langCode)) {
-    fs.mkdirSync(path.join(root, langCode));
+  var outputDir = path.join(root, langCode);
+  if (!fs.existsSync(outputDir)) {
+    fs.mkdirSync(outputDir);
   }
 
   // Download the necessary files for this language.
   files.forEach(function(fileName) {
-    var outputPath = path.join(root, langCode, fileName);
+    var outputPath = path.join(outputDir, fileName);
     var url = MOZCENTRAL_ROOT + langCode + MOZCENTRAL_PDFJS_DIR +
               fileName + MOZCENTRAL_RAW_FLAG;
     var request = http.get(url, function(response) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list