This commit is contained in:
Vendored
+39
-7
@@ -1,14 +1,46 @@
|
||||
declare module "vinyl" {
|
||||
export class File {
|
||||
path: string;
|
||||
import { type Stats } from "fs";
|
||||
import type Stream from "stream";
|
||||
|
||||
export type Contents = Stream | Buffer | null;
|
||||
|
||||
export interface Options<C extends Contents = Contents> {
|
||||
contents?: C;
|
||||
cwd?: string;
|
||||
base?: string;
|
||||
path?: string;
|
||||
stat?: Stats;
|
||||
history?: string[];
|
||||
}
|
||||
|
||||
export class File<C extends Contents = Contents> {
|
||||
contents: C;
|
||||
cwd: string;
|
||||
base: string;
|
||||
contents: any;
|
||||
stat: any;
|
||||
history: any[];
|
||||
constructor(params: any);
|
||||
clone(options?: any);
|
||||
relative: string;
|
||||
dirname: string;
|
||||
basename: string;
|
||||
stem: string;
|
||||
extname: string;
|
||||
path: string;
|
||||
symlink: string;
|
||||
stat: Stats;
|
||||
history: string[];
|
||||
|
||||
constructor(options?: Options<C>);
|
||||
isBuffer(): boolean;
|
||||
isStream(): boolean;
|
||||
isNull(): boolean;
|
||||
isDirectory(): boolean;
|
||||
isSymbolic(): boolean;
|
||||
clone(options?: Options<C>);
|
||||
|
||||
static isCustomProp(key: string): boolean;
|
||||
static isVinyl(file: File | any): boolean;
|
||||
}
|
||||
|
||||
export type StreamFile = File<Stream>;
|
||||
export type BufferFile = File<Buffer>;
|
||||
|
||||
export default File;
|
||||
}
|
||||
|
||||
+15
-3
@@ -1,10 +1,22 @@
|
||||
import async from "async";
|
||||
import async, { type ErrorCallback } from "async";
|
||||
import child_process from "child_process";
|
||||
import { Logger } from "./log";
|
||||
|
||||
const log = new Logger("exec");
|
||||
|
||||
const queue = async.queue((task: any, done: any) => {
|
||||
export interface Result {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
interface Task {
|
||||
dir: string;
|
||||
command: string;
|
||||
success: (result: Result) => void;
|
||||
failure: (error: string) => void;
|
||||
}
|
||||
|
||||
const queue = async.queue((task: Task, done: ErrorCallback) => {
|
||||
log.d("*%s*", task.command);
|
||||
//process.chdir(task.dir);
|
||||
child_process.exec(task.command, { cwd: task.dir, maxBuffer: 1024 * 10000 }, (err, stdout, stderr) => {
|
||||
@@ -19,7 +31,7 @@ const queue = async.queue((task: any, done: any) => {
|
||||
});
|
||||
});
|
||||
|
||||
export default (dir: string, command: string) => {
|
||||
export default (dir: string, command: string): Promise<Result> => {
|
||||
return new Promise((success, failure) => {
|
||||
queue.push({
|
||||
dir: dir,
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ class BufferingTransform extends Transform {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
export class TailVinyl extends Vinyl {
|
||||
|
||||
export class TailVinyl extends Vinyl<BufferingTransform> {
|
||||
private tail?: Tail;
|
||||
|
||||
constructor(params: WatchParams) {
|
||||
|
||||
@@ -18,7 +18,7 @@ export class HaxeBuilder extends Builder {
|
||||
}
|
||||
|
||||
prepare() {
|
||||
let result = this.haxe.prepare().then(() => this.haxe.install(this.config.libs));
|
||||
let result: Promise<any> = this.haxe.prepare().then(() => this.haxe.install(this.config.libs));
|
||||
if (this.buildSystem === BuildSystem.OPENFL) {
|
||||
if (this.platform === Platform.ANDROID) {
|
||||
result = result
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ export class Command {
|
||||
this.options.env.PATH += previousPath;
|
||||
}
|
||||
|
||||
exec(stdin?: any, callback?: any) {
|
||||
exec(stdin?: any, callback?: any): Vinyl<stream.Stream> {
|
||||
let fileName;
|
||||
let directory;
|
||||
let subShell;
|
||||
|
||||
Reference in New Issue
Block a user