@pi-r/gulp 0.3.6 → 0.3.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/index.js CHANGED
@@ -193,7 +193,8 @@ class Gulp extends Task {
193
193
  writeError("Unable to create temp directory", null, this.getTempDir());
194
194
  return;
195
195
  }
196
- let { path: gulpfile, tasks, opts, items } = data;
196
+ const exec = this.settings.exec;
197
+ let { path: gulpfile, tasks, opts, items } = data, uid, gid;
197
198
  if (!Array.isArray(tasks)) {
198
199
  tasks = (0, types_1.isString)(tasks) ? [tasks] : [task];
199
200
  }
@@ -233,6 +234,15 @@ class Gulp extends Task {
233
234
  }
234
235
  opts.splice(i--, 1);
235
236
  }
237
+ if ((0, types_1.isPlainObject)(exec)) {
238
+ let { uid: u, gid: g } = exec;
239
+ if ((u = parseInt(u)) >= 0) {
240
+ uid = u;
241
+ }
242
+ if ((g = parseInt(g)) >= 0) {
243
+ gid = g;
244
+ }
245
+ }
236
246
  const startTime = process.hrtime();
237
247
  const broadcastId = this.broadcastId;
238
248
  this.formatMessage(4, "gulp", ['Executing task...', task], gulpfile);
@@ -253,7 +263,7 @@ class Gulp extends Task {
253
263
  timeStamp = '';
254
264
  }
255
265
  };
256
- const { stdout, stderr } = child_process.spawn(BIN_GULP || BIN_NPX, args, { cwd: process.cwd(), shell: true, stdio: Task.hasLogType(32768) && !broadcastId ? 'inherit' : undefined, signal: this.signal })
266
+ const { stdout, stderr } = child_process.spawn(BIN_GULP || BIN_NPX, args, { cwd: process.cwd(), shell: true, stdio: Task.hasLogType(32768) && !broadcastId ? 'inherit' : undefined, signal: this.signal, uid, gid })
257
267
  .on('exit', code => {
258
268
  if (!code) {
259
269
  this.addLog(types_1.STATUS_TYPE.INFO, out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/gulp",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Gulp task constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
package/types/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { ExecAction } from '@e-mc/types/lib/settings';
2
+
1
3
  export interface GulpCommand {
2
4
  path?: string;
3
5
  tasks?: StringOfArray;
@@ -9,6 +11,7 @@ export interface GulpData extends GulpCommand {
9
11
  }
10
12
 
11
13
  export interface GulpSettings extends ObjectMap<GulpTask>, PlainObject {
14
+ exec?: ExecAction;
12
15
  users?: GulpUsers;
13
16
  }
14
17