-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Application entry can't be found
Closes #371
- Loading branch information
Showing
14 changed files
with
521 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Promise as BluebirdPromise } from "bluebird" | ||
import { Glob, Options } from "glob" | ||
|
||
//noinspection JSUnusedLocalSymbols | ||
const __awaiter = require("./awaiter") | ||
|
||
function isNegative(pattern: string): boolean { | ||
return pattern[0] === "!" | ||
} | ||
|
||
function generateGlobTasks(patterns: Array<string>, opts: Options): Array<any> { | ||
opts = Object.assign({ignore: []}, opts) | ||
|
||
const globTasks: Array<any> = [] | ||
patterns.forEach(function (pattern, i) { | ||
if (isNegative(pattern)) { | ||
return | ||
} | ||
|
||
const ignore = patterns.slice(i).filter(isNegative).map(it => it.slice(1)) | ||
globTasks.push({ | ||
pattern: pattern, | ||
opts: Object.assign({}, opts, { | ||
ignore: (<Array<string>>opts.ignore).concat(ignore) | ||
}) | ||
}) | ||
}) | ||
return globTasks | ||
} | ||
|
||
export function globby(patterns: Array<string>, opts: Options): Promise<Set<string>> { | ||
let firstGlob: Glob | null = null | ||
return BluebirdPromise | ||
.map(generateGlobTasks(patterns, opts), task => new BluebirdPromise((resolve, reject) => { | ||
let glob = new Glob(task.pattern, task.opts, (error, matches) => { | ||
if (error == null) { | ||
resolve(matches) | ||
} | ||
else { | ||
reject(error) | ||
} | ||
}) | ||
|
||
if (firstGlob == null) { | ||
firstGlob = glob | ||
} | ||
else { | ||
glob.statCache = firstGlob.statCache | ||
glob.symlinks = firstGlob.symlinks | ||
glob.realpathCache = firstGlob.realpathCache | ||
glob.cache = firstGlob.cache | ||
} | ||
})) | ||
.then(it => new Set([].concat(...it))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
declare module "asar" { | ||
import { Stats } from "fs" | ||
|
||
interface Info { | ||
offset: number | ||
size: number | ||
} | ||
|
||
interface AsarFileMetadata { | ||
type: "file" | "directory" | "link" | ||
stat: Stats | ||
} | ||
|
||
interface AsarOptions { | ||
unpack?: string | ||
unpackDir?: string | ||
} | ||
|
||
export function listPackage(archive: string): Array<string> | ||
|
||
// followLinks defaults to true | ||
export function statFile(archive: string, filename: string, followLinks?: boolean): Info | null | ||
|
||
export function createPackageFromFiles(src: string, dest: string, filenames: Array<string>, metadata: { [key: string]: AsarFileMetadata;}, options: AsarOptions, callback: (error?: Error) => void): void | ||
} |
Oops, something went wrong.