mapshaper 0.6.4 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,7 +38,7 @@ The web UI works in recent desktop versions of Chrome, Firefox, Safari and Inter
38
38
 
39
39
  [Here](https://hub.docker.com/r/freifunkhamm/mapshaper) are resources for using mapshaper with Docker, provided by Christian Weiss.
40
40
 
41
- You can find a number of mapshaper tutorials online, including a [two](https://moriartynaps.org/command-carto-part-one/) [part](https://moriartynaps.org/command-carto-part-two/) guide to command line cartography by Dylan Moriarty and [this introduction](https://datavizforall.org/convert-edit-join-and-dissolve-with-mapshaper-org.html) by Jack Dougherty.
41
+ You can find a number of mapshaper tutorials online, including a [two](https://moriartynaps.org/command-carto-part-one/) [part](https://moriartynaps.org/command-carto-part-two/) guide to command line cartography by Dylan Moriarty and [this introduction](https://handsondataviz.org/mapshaper.html) by Jack Dougherty.
42
42
 
43
43
 
44
44
  ## Large file support
package/mapshaper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.6.4";
3
+ var VERSION = "0.6.7";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -30940,7 +30940,7 @@ ${svg}
30940
30940
 
30941
30941
  var plasma = ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
30942
30942
 
30943
- var lib = /*#__PURE__*/Object.freeze({
30943
+ var d3Scales = /*#__PURE__*/Object.freeze({
30944
30944
  __proto__: null,
30945
30945
  schemeCategory10: category10,
30946
30946
  schemeAccent: Accent,
@@ -31077,7 +31077,6 @@ ${svg}
31077
31077
  }
31078
31078
 
31079
31079
  function testLib() {
31080
- var lib = require('d3-scale-chromatic');
31081
31080
  schemes(index.categorical);
31082
31081
  schemes(index.sequential);
31083
31082
  schemes(index.diverging);
@@ -31087,7 +31086,7 @@ ${svg}
31087
31086
 
31088
31087
  function schemes(arr) {
31089
31088
  arr.forEach(function(name) {
31090
- if (!lib['scheme' + name]) {
31089
+ if (!d3Scales['scheme' + name]) {
31091
31090
  message('Warning: missing data for', name);
31092
31091
  }
31093
31092
  });
@@ -31095,7 +31094,7 @@ ${svg}
31095
31094
 
31096
31095
  function interpolators(arr) {
31097
31096
  arr.forEach(function(name) {
31098
- if (!lib['interpolate' + name]) {
31097
+ if (!d3Scales['interpolate' + name]) {
31099
31098
  message('Missing interpolator for', name);
31100
31099
  }
31101
31100
  });
@@ -31134,7 +31133,7 @@ ${svg}
31134
31133
  if (!isColorSchemeName(name)) {
31135
31134
  stop('Unknown color scheme name:', name);
31136
31135
  } else if (isCategoricalColorScheme(name)) {
31137
- colors = ramps[name] || require('d3-scale-chromatic')['scheme' + name];
31136
+ colors = ramps[name] || d3Scales['scheme' + name];
31138
31137
  } else {
31139
31138
  colors = getColorRamp(name, n);
31140
31139
  }
@@ -31168,9 +31167,8 @@ ${svg}
31168
31167
  function getColorRamp(name, n, stops) {
31169
31168
  initSchemes();
31170
31169
  name = standardName(name);
31171
- // var lib = require('d3-scale-chromatic');
31172
- var ramps = lib['scheme' + name];
31173
- var interpolate = lib['interpolate' + name];
31170
+ var ramps = d3Scales['scheme' + name];
31171
+ var interpolate = d3Scales['interpolate' + name];
31174
31172
  var ramp;
31175
31173
  if (!ramps && !interpolate) {
31176
31174
  stop('Unknown color scheme name:', name);
@@ -36806,6 +36804,7 @@ ${svg}
36806
36804
  } else {
36807
36805
  ctx = getNullLayerProxy(targets);
36808
36806
  }
36807
+ ctx.global = getStashedVar('defs') || {}; // TODO: remove duplication with mapshaper.expressions.mjs
36809
36808
  var exprOpts = Object.assign({returns: true}, opts);
36810
36809
  var func = compileExpressionToFunction(expr, exprOpts);
36811
36810
 
@@ -42084,6 +42083,13 @@ ${svg}
42084
42083
  inputObj = null;
42085
42084
  }
42086
42085
 
42086
+ if (commands.length === 0) {
42087
+ return callback(new UserError("No commands to run"));
42088
+ }
42089
+
42090
+ commands = runAndRemoveInfoCommands(commands);
42091
+ if (commands.length === 0) return done(null);
42092
+
42087
42093
  // add options to -i -o -join -clip -erase commands to bypass file i/o
42088
42094
  // TODO: find a less kludgy solution
42089
42095
  commands.forEach(function(cmd) {
@@ -42095,7 +42101,20 @@ ${svg}
42095
42101
  }
42096
42102
  });
42097
42103
 
42098
- runParsedCommands(commands, null, callback);
42104
+ var batches = divideImportCommand(commands);
42105
+ utils.reduceAsync(batches, null, nextGroup, done);
42106
+
42107
+ function nextGroup(prevJob, commands, next) {
42108
+ runParsedCommands(commands, new Job(), function(err, job) {
42109
+ err = filterError(err);
42110
+ next(err, job);
42111
+ });
42112
+ }
42113
+
42114
+ function done(err, job) {
42115
+ err = filterError(err);
42116
+ callback(err, job);
42117
+ }
42099
42118
  }
42100
42119
 
42101
42120
  function commandTakesFileInput(name) {
@@ -42142,23 +42161,19 @@ ${svg}
42142
42161
  });
42143
42162
  }
42144
42163
 
42164
+
42145
42165
  // Execute a sequence of parsed commands
42146
42166
  // @commands Array of parsed commands
42147
- // @job: Optional Job object containing previously imported data
42148
- // @cb: function(<error>, <catalog>)
42167
+ // @job: Job object containing previously imported data
42168
+ // @done: function([error], [job])
42149
42169
  //
42150
- function runParsedCommands(commands, job, cb) {
42151
- if (!job) {
42152
- job = new Job();
42153
- }
42154
-
42155
- if (!utils.isArray(commands)) {
42156
- error("Expected an array of parsed commands");
42157
- }
42158
-
42159
- if (commands.length === 0) {
42160
- return done(new UserError("No commands to run"));
42170
+ function runParsedCommands(commands, job, done) {
42171
+ if (!runningInBrowser() && commands[commands.length-1].name == 'o') {
42172
+ // in CLI, set 'final' flag on final -o command, so the export function knows
42173
+ // that it can modify the output dataset in-place instead of making a copy.
42174
+ commands[commands.length-1].options.final = true;
42161
42175
  }
42176
+ if (!job) job = new Job();
42162
42177
  commands = readAndRemoveSettings(job, commands);
42163
42178
  if (!runningInBrowser()) {
42164
42179
  printStartupMessages();
@@ -42167,31 +42182,13 @@ ${svg}
42167
42182
  if (commands.length === 0) {
42168
42183
  return done(null);
42169
42184
  }
42170
- if (!runningInBrowser() && commands[commands.length-1].name == 'o') {
42171
- // in CLI, set 'final' flag on final -o command, so the export function knows
42172
- // that it can modify the output dataset in-place instead of making a copy.
42173
- commands[commands.length-1].options.final = true;
42174
- }
42175
-
42176
- var groups = divideImportCommand(commands);
42177
- if (groups.length == 1) {
42178
- // run a simple sequence of commands (input files are not batched)
42179
- return runParsedCommands2(commands, job, done);
42180
- }
42181
-
42182
- // run duplicated commands (i.e. batch mode)
42183
- utils.reduceAsync(groups, job, nextGroup, done);
42184
-
42185
- function nextGroup(job, commands, next) {
42186
- runParsedCommands2(commands, job, function(err, job) {
42187
- err = filterError(err);
42188
- next(err, job);
42189
- });
42190
- }
42185
+ // we're no longer using the same Job for all batches -- no reset needed
42186
+ // // resetting closes any unterminated -if blocks from a previous command sequence
42187
+ // resetControlFlow(job);
42188
+ utils.reduceAsync(commands, job, nextCommand, done);
42191
42189
 
42192
- function done(err, job) {
42193
- err = filterError(err);
42194
- cb(err, job);
42190
+ function nextCommand(job, cmd, next) {
42191
+ runCommand(cmd, job, next);
42195
42192
  }
42196
42193
  }
42197
42194
 
@@ -42203,17 +42200,6 @@ ${svg}
42203
42200
  return err;
42204
42201
  }
42205
42202
 
42206
- function runParsedCommands2(commands, job, cb) {
42207
- // resetting closes any unterminated -if blocks from a previous command sequence
42208
- resetControlFlow(job);
42209
- utils.reduceAsync(commands, job, nextCommand, cb);
42210
-
42211
- function nextCommand(job, cmd, next) {
42212
- runCommand(cmd, job, next);
42213
- }
42214
- }
42215
-
42216
-
42217
42203
  // If an initial import command indicates that several input files should be
42218
42204
  // processed separately, then duplicate the sequence of commands to run
42219
42205
  // once for each input file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mapshaper",
3
- "version": "0.6.4",
3
+ "version": "0.6.7",
4
4
  "description": "A tool for editing vector datasets for mapping and GIS.",
5
5
  "keywords": [
6
6
  "shapefile",
@@ -25,7 +25,7 @@
25
25
  "scripts": {
26
26
  "test": "mocha test",
27
27
  "build": "rollup --config",
28
- "lint": "eslint --ext mjs src/",
28
+ "lint": "eslint --ext mjs src/",
29
29
  "prepublishOnly": "npm lint; npm test; ./pre-publish",
30
30
  "postpublish": "./release_web_ui; ./release_github_version",
31
31
  "browserify": "browserify -r sync-request -r mproj -r buffer -r iconv-lite -r fs -r flatbush -r rw -r path -r kdbush -r @tmcw/togeojson -o www/modules.js",
@@ -35,7 +35,6 @@
35
35
  "files": [
36
36
  "/bin/**",
37
37
  "/www/**",
38
- "!/www/basemap.js",
39
38
  "!/www/nacis/**",
40
39
  "/mapshaper.js",
41
40
  "!.DS_Store"
package/www/basemap.js ADDED
@@ -0,0 +1,15 @@
1
+ window.mapboxParams = {
2
+ js: 'https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.js',
3
+ css: 'https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css',
4
+ key: 'pk.eyJ1IjoiZ3JhbW1hdGEiLCJhIjoiY2wxMzI4b3dqMDNhMjNpcDhzcmU0aGh5diJ9.m1lacx48pTYls-X3FVhG9g',
5
+ styles: [{
6
+ name: 'Map',
7
+ icon: 'images/thumb-map.jpg',
8
+ url: 'mapbox://styles/grammata/cl0ymri0f000214lc1mgtweqk'
9
+ }, {
10
+ name: 'Satellite',
11
+ icon: 'images/thumb-satellite.jpg',
12
+ dark: true,
13
+ url: 'mapbox://styles/grammata/cl0ymvkkl004115mlgf5o442n'
14
+ }]
15
+ };
@@ -2488,6 +2488,7 @@
2488
2488
  var historyId = 0;
2489
2489
  var _isOpen = false;
2490
2490
  var btn = gui.container.findChild('.console-btn').on('click', toggle);
2491
+ var globals = {}; // share user-defined globals between runs
2491
2492
 
2492
2493
  // expose this function, so other components can run commands (e.g. box tool)
2493
2494
  this.runMapshaperCommands = runMapshaperCommands;
@@ -2863,7 +2864,12 @@
2863
2864
  if (commands.length === 0) return done();
2864
2865
  applyParsedCommands(commands, function(err, flags) {
2865
2866
  if (!err) {
2866
- gui.session.consoleCommands(internal.standardizeConsoleCommands(str));
2867
+ str = internal.standardizeConsoleCommands(str);
2868
+ gui.session.consoleCommands(str);
2869
+ // kludge to terminate unclosed -if blocks
2870
+ if (str.includes('-if') && !str.includes('-endif')) {
2871
+ gui.session.consoleCommands('-endif');
2872
+ }
2867
2873
  }
2868
2874
  if (flags) {
2869
2875
  // if the command may have changed data, and a tool with an edit mode is being used,
@@ -2884,6 +2890,8 @@
2884
2890
  prevTableSize = prevTable ? prevTable.size() : 0,
2885
2891
  prevArcCount = prevArcs ? prevArcs.size() : 0,
2886
2892
  job = new internal.Job(model);
2893
+
2894
+ job.defs = globals; // share globals between runs
2887
2895
  internal.runParsedCommands(commands, job, function(err) {
2888
2896
  var flags = getCommandFlags(commands),
2889
2897
  active2 = model.getActiveLayer(),
@@ -9782,6 +9790,7 @@
9782
9790
  var faded = false;
9783
9791
 
9784
9792
  if (params) {
9793
+ // TODO: check page URL for compatibility with mapbox key
9785
9794
  init();
9786
9795
  } else {
9787
9796
  basemapBtn.hide();
package/www/mapshaper.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function () {
2
2
 
3
- var VERSION = "0.6.4";
3
+ var VERSION = "0.6.7";
4
4
 
5
5
 
6
6
  var utils = /*#__PURE__*/Object.freeze({
@@ -30940,7 +30940,7 @@ ${svg}
30940
30940
 
30941
30941
  var plasma = ramp(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
30942
30942
 
30943
- var lib = /*#__PURE__*/Object.freeze({
30943
+ var d3Scales = /*#__PURE__*/Object.freeze({
30944
30944
  __proto__: null,
30945
30945
  schemeCategory10: category10,
30946
30946
  schemeAccent: Accent,
@@ -31077,7 +31077,6 @@ ${svg}
31077
31077
  }
31078
31078
 
31079
31079
  function testLib() {
31080
- var lib = require('d3-scale-chromatic');
31081
31080
  schemes(index.categorical);
31082
31081
  schemes(index.sequential);
31083
31082
  schemes(index.diverging);
@@ -31087,7 +31086,7 @@ ${svg}
31087
31086
 
31088
31087
  function schemes(arr) {
31089
31088
  arr.forEach(function(name) {
31090
- if (!lib['scheme' + name]) {
31089
+ if (!d3Scales['scheme' + name]) {
31091
31090
  message('Warning: missing data for', name);
31092
31091
  }
31093
31092
  });
@@ -31095,7 +31094,7 @@ ${svg}
31095
31094
 
31096
31095
  function interpolators(arr) {
31097
31096
  arr.forEach(function(name) {
31098
- if (!lib['interpolate' + name]) {
31097
+ if (!d3Scales['interpolate' + name]) {
31099
31098
  message('Missing interpolator for', name);
31100
31099
  }
31101
31100
  });
@@ -31134,7 +31133,7 @@ ${svg}
31134
31133
  if (!isColorSchemeName(name)) {
31135
31134
  stop('Unknown color scheme name:', name);
31136
31135
  } else if (isCategoricalColorScheme(name)) {
31137
- colors = ramps[name] || require('d3-scale-chromatic')['scheme' + name];
31136
+ colors = ramps[name] || d3Scales['scheme' + name];
31138
31137
  } else {
31139
31138
  colors = getColorRamp(name, n);
31140
31139
  }
@@ -31168,9 +31167,8 @@ ${svg}
31168
31167
  function getColorRamp(name, n, stops) {
31169
31168
  initSchemes();
31170
31169
  name = standardName(name);
31171
- // var lib = require('d3-scale-chromatic');
31172
- var ramps = lib['scheme' + name];
31173
- var interpolate = lib['interpolate' + name];
31170
+ var ramps = d3Scales['scheme' + name];
31171
+ var interpolate = d3Scales['interpolate' + name];
31174
31172
  var ramp;
31175
31173
  if (!ramps && !interpolate) {
31176
31174
  stop('Unknown color scheme name:', name);
@@ -36806,6 +36804,7 @@ ${svg}
36806
36804
  } else {
36807
36805
  ctx = getNullLayerProxy(targets);
36808
36806
  }
36807
+ ctx.global = getStashedVar('defs') || {}; // TODO: remove duplication with mapshaper.expressions.mjs
36809
36808
  var exprOpts = Object.assign({returns: true}, opts);
36810
36809
  var func = compileExpressionToFunction(expr, exprOpts);
36811
36810
 
@@ -42084,6 +42083,13 @@ ${svg}
42084
42083
  inputObj = null;
42085
42084
  }
42086
42085
 
42086
+ if (commands.length === 0) {
42087
+ return callback(new UserError("No commands to run"));
42088
+ }
42089
+
42090
+ commands = runAndRemoveInfoCommands(commands);
42091
+ if (commands.length === 0) return done(null);
42092
+
42087
42093
  // add options to -i -o -join -clip -erase commands to bypass file i/o
42088
42094
  // TODO: find a less kludgy solution
42089
42095
  commands.forEach(function(cmd) {
@@ -42095,7 +42101,20 @@ ${svg}
42095
42101
  }
42096
42102
  });
42097
42103
 
42098
- runParsedCommands(commands, null, callback);
42104
+ var batches = divideImportCommand(commands);
42105
+ utils.reduceAsync(batches, null, nextGroup, done);
42106
+
42107
+ function nextGroup(prevJob, commands, next) {
42108
+ runParsedCommands(commands, new Job(), function(err, job) {
42109
+ err = filterError(err);
42110
+ next(err, job);
42111
+ });
42112
+ }
42113
+
42114
+ function done(err, job) {
42115
+ err = filterError(err);
42116
+ callback(err, job);
42117
+ }
42099
42118
  }
42100
42119
 
42101
42120
  function commandTakesFileInput(name) {
@@ -42142,23 +42161,19 @@ ${svg}
42142
42161
  });
42143
42162
  }
42144
42163
 
42164
+
42145
42165
  // Execute a sequence of parsed commands
42146
42166
  // @commands Array of parsed commands
42147
- // @job: Optional Job object containing previously imported data
42148
- // @cb: function(<error>, <catalog>)
42167
+ // @job: Job object containing previously imported data
42168
+ // @done: function([error], [job])
42149
42169
  //
42150
- function runParsedCommands(commands, job, cb) {
42151
- if (!job) {
42152
- job = new Job();
42153
- }
42154
-
42155
- if (!utils.isArray(commands)) {
42156
- error("Expected an array of parsed commands");
42157
- }
42158
-
42159
- if (commands.length === 0) {
42160
- return done(new UserError("No commands to run"));
42170
+ function runParsedCommands(commands, job, done) {
42171
+ if (!runningInBrowser() && commands[commands.length-1].name == 'o') {
42172
+ // in CLI, set 'final' flag on final -o command, so the export function knows
42173
+ // that it can modify the output dataset in-place instead of making a copy.
42174
+ commands[commands.length-1].options.final = true;
42161
42175
  }
42176
+ if (!job) job = new Job();
42162
42177
  commands = readAndRemoveSettings(job, commands);
42163
42178
  if (!runningInBrowser()) {
42164
42179
  printStartupMessages();
@@ -42167,31 +42182,13 @@ ${svg}
42167
42182
  if (commands.length === 0) {
42168
42183
  return done(null);
42169
42184
  }
42170
- if (!runningInBrowser() && commands[commands.length-1].name == 'o') {
42171
- // in CLI, set 'final' flag on final -o command, so the export function knows
42172
- // that it can modify the output dataset in-place instead of making a copy.
42173
- commands[commands.length-1].options.final = true;
42174
- }
42175
-
42176
- var groups = divideImportCommand(commands);
42177
- if (groups.length == 1) {
42178
- // run a simple sequence of commands (input files are not batched)
42179
- return runParsedCommands2(commands, job, done);
42180
- }
42181
-
42182
- // run duplicated commands (i.e. batch mode)
42183
- utils.reduceAsync(groups, job, nextGroup, done);
42184
-
42185
- function nextGroup(job, commands, next) {
42186
- runParsedCommands2(commands, job, function(err, job) {
42187
- err = filterError(err);
42188
- next(err, job);
42189
- });
42190
- }
42185
+ // we're no longer using the same Job for all batches -- no reset needed
42186
+ // // resetting closes any unterminated -if blocks from a previous command sequence
42187
+ // resetControlFlow(job);
42188
+ utils.reduceAsync(commands, job, nextCommand, done);
42191
42189
 
42192
- function done(err, job) {
42193
- err = filterError(err);
42194
- cb(err, job);
42190
+ function nextCommand(job, cmd, next) {
42191
+ runCommand(cmd, job, next);
42195
42192
  }
42196
42193
  }
42197
42194
 
@@ -42203,17 +42200,6 @@ ${svg}
42203
42200
  return err;
42204
42201
  }
42205
42202
 
42206
- function runParsedCommands2(commands, job, cb) {
42207
- // resetting closes any unterminated -if blocks from a previous command sequence
42208
- resetControlFlow(job);
42209
- utils.reduceAsync(commands, job, nextCommand, cb);
42210
-
42211
- function nextCommand(job, cmd, next) {
42212
- runCommand(cmd, job, next);
42213
- }
42214
- }
42215
-
42216
-
42217
42203
  // If an initial import command indicates that several input files should be
42218
42204
  // processed separately, then duplicate the sequence of commands to run
42219
42205
  // once for each input file