mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: Fix generating tray icons and downloading binaries on windows
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
30f794d66d
commit
289d62caaa
3 files changed
+40
-15
No files matched your search
@@ -23,7 +23,7 @@ type Options = typeof options;
|
||||
const assertOption = <Key extends keyof Options>(key: Key): NonNullable<Options[Key]> => {
|
||||
const raw = options[key];
|
||||
|
||||
if (!raw) {
|
||||
if (raw === undefined) {
|
||||
console.error(`missing ${key} option`);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -31,11 +31,21 @@ const assertOption = <Key extends keyof Options>(key: Key): NonNullable<Options[
|
||||
return raw;
|
||||
};
|
||||
|
||||
const joinWithInitCwd = (relativePath: string): string => {
|
||||
const { INIT_CWD } = process.env;
|
||||
|
||||
if (!INIT_CWD) {
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
return path.join(INIT_CWD, relativePath);
|
||||
};
|
||||
|
||||
const size = options["--output-size"] ?? 16;
|
||||
const inputFile = assertOption("--input");
|
||||
const outputFolder = assertOption("--output");
|
||||
const noticeFile = assertOption("--notice-icon");
|
||||
const spinnerFile = assertOption("--spinner-icon");
|
||||
const inputFile = joinWithInitCwd(assertOption("--input"));
|
||||
const outputFolder = joinWithInitCwd(assertOption("--output"));
|
||||
const noticeFile = joinWithInitCwd(assertOption("--notice-icon"));
|
||||
const spinnerFile = joinWithInitCwd(assertOption("--spinner-icon"));
|
||||
|
||||
const getSvgStyling = (colouring: "dark" | "light") => (
|
||||
`
|
||||
|
||||
Reference in new issue
Block a user