@pi-r/gulp 0.2.3 → 0.3.1

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
@@ -194,7 +194,8 @@ class Gulp extends Task {
194
194
  writeError("Unable to create temp directory" /* ERR_MESSAGE.TEMP_DIRECTORY */, null, this.getTempDir());
195
195
  return;
196
196
  }
197
- let { path: gulpfile, tasks, opts, items } = data;
197
+ const exec = this.settings.exec;
198
+ let { path: gulpfile, tasks, opts, items } = data, uid, gid;
198
199
  if (!Array.isArray(tasks)) {
199
200
  tasks = (0, types_1.isString)(tasks) ? [tasks] : [task];
200
201
  }
@@ -234,6 +235,15 @@ class Gulp extends Task {
234
235
  }
235
236
  opts.splice(i--, 1);
236
237
  }
238
+ if ((0, types_1.isPlainObject)(exec)) {
239
+ let { uid: u, gid: g } = exec;
240
+ if ((u = parseInt(u)) >= 0) {
241
+ uid = u;
242
+ }
243
+ if ((g = parseInt(g)) >= 0) {
244
+ gid = g;
245
+ }
246
+ }
237
247
  const startTime = process.hrtime();
238
248
  const broadcastId = this.broadcastId;
239
249
  this.formatMessage(4 /* LOG_TYPE.PROCESS */, "gulp" /* STRINGS.MODULE_NAME */, ['Executing task...', task], gulpfile);
@@ -254,7 +264,7 @@ class Gulp extends Task {
254
264
  timeStamp = '';
255
265
  }
256
266
  };
257
- const { stdout, stderr } = child_process.spawn(BIN_GULP || BIN_NPX, args, { cwd: process.cwd(), shell: true, stdio: Task.hasLogType(32768 /* LOG_TYPE.STDOUT */) && !broadcastId ? 'inherit' : undefined, signal: this.signal })
267
+ const { stdout, stderr } = child_process.spawn(BIN_GULP || BIN_NPX, args, { cwd: process.cwd(), shell: true, stdio: Task.hasLogType(32768 /* LOG_TYPE.STDOUT */) && !broadcastId ? 'inherit' : undefined, signal: this.signal, uid, gid })
258
268
  .on('exit', code => {
259
269
  if (!code) {
260
270
  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.2.3",
3
+ "version": "0.3.1",
4
4
  "description": "Gulp task constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/task": "^0.5.3",
24
- "@e-mc/types": "^0.5.3",
23
+ "@e-mc/task": "^0.6.0",
24
+ "@e-mc/types": "^0.6.0",
25
25
  "gulp": "^4.0.2",
26
26
  "gulp-cli": "^2.3.0",
27
27
  "strip-ansi": "6.0.1",
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