1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

chore: Fix build failing on non-windows platforms

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-05-09 11:29:31 -04:00
parent c4d56ef1a7
commit 786e0e8ac9

View File

@ -10,6 +10,7 @@ import path from "path";
import sharp from "sharp"; import sharp from "sharp";
import arg from "arg"; import arg from "arg";
import assert from "assert"; import assert from "assert";
import { platform } from "process";
const options = arg({ const options = arg({
"--input": String, "--input": String,
@ -45,7 +46,11 @@ const joinWithInitCwd = (relativePath: string): string => {
const resolve = async (input: string) => { const resolve = async (input: string) => {
const filePath = await import.meta.resolve?.(input); const filePath = await import.meta.resolve?.(input);
if (platform === "win32") {
return filePath?.replace("file:///", ""); return filePath?.replace("file:///", "");
} else {
return filePath?.replace("file://", "");
}
} }
const size = options["--output-size"] ?? 16; const size = options["--output-size"] ?? 16;