Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/159178

Change subject: Add -T option to CLI to specify a temporary directory.
......................................................................

Add -T option to CLI to specify a temporary directory.

This does the same thing as setting $TMPDIR in the environment.

See change I43cf578da61978a3fb0baab6e93139210c5348e0 for the
corresponding commit in the `mw-ocg-latexer` package.

Change-Id: I1a9dc18bf1563ad13b40fba9ebc5093ee8c92bde
---
M bin/mw-ocg-texter
M lib/index.js
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/text_renderer
 refs/changes/78/159178/1

diff --git a/bin/mw-ocg-texter b/bin/mw-ocg-texter
index 3015fc4..be37005 100755
--- a/bin/mw-ocg-texter
+++ b/bin/mw-ocg-texter
@@ -18,6 +18,8 @@
                        'Print verbose progress information')
        .option('-D, --debug',
                        'Turn on debugging features (eg, full stack traces on 
exceptions)')
+       .option('-T, --temporary-directory <dir>',
+                       'Use <dir> for temporaries, not $TMPDIR or /tmp', null)
        .option('--syslog',
                        'Log errors using syslog (for production deployments)');
 
@@ -61,6 +63,7 @@
        noRefs: !program.refs,
        debug: !!program.debug,
        output: program.output,
+       tmpdir: program.temporaryDirectory,
        log: log
 };
 
diff --git a/lib/index.js b/lib/index.js
index dc36f90..c7de1c4 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -883,6 +883,7 @@
        // first create a temporary directory
        return P.call(tmp.dir, tmp, {
                prefix: json.name,
+               dir: options.tmpdir,
                unsafeCleanup: !(options.debug)
        }).then(function(_builddir) {
                builddir = _builddir;
@@ -913,6 +914,7 @@
        // first create a temporary directory
        return P.call(tmp.dir, tmp, {
                prefix: json.name,
+               dir: options.tmpdir,
                unsafeCleanup: !(options.debug)
        }).then(function(_builddir) {
                builddir = _builddir;

-- 
To view, visit https://gerrit.wikimedia.org/r/159178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a9dc18bf1563ad13b40fba9ebc5093ee8c92bde
Gerrit-PatchSet: 1
Gerrit-Project: 
mediawiki/extensions/Collection/OfflineContentGenerator/text_renderer
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to