esbuild-plugin-scriptable
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -45,4 +45,4 @@ 'use strict'; | ||
} | ||
function normalizePath(p, resolve2 = false) { | ||
const resolved = resolve2 ? fs.realpathSync(path__default.default.resolve(p)) : p; | ||
function normalizePath(p, shouldResolve = false) { | ||
const resolved = shouldResolve && fs.existsSync(p) ? fs.realpathSync(path__default.default.resolve(p)) : p; | ||
return resolved.replace(/\\/g, "/"); | ||
@@ -49,0 +49,0 @@ } |
@@ -19,3 +19,3 @@ import micromatch from 'micromatch'; | ||
declare function waitForFile(filePath: string, timeout?: number): Promise<void>; | ||
declare function normalizePath(p: string, resolve?: boolean): string; | ||
declare function normalizePath(p: string, shouldResolve?: boolean): string; | ||
declare function normalizeAndResolvePath(p: string): string; | ||
@@ -22,0 +22,0 @@ declare const np: typeof normalizePath; |
@@ -38,4 +38,4 @@ import { existsSync, realpathSync } from 'fs'; | ||
} | ||
function normalizePath(p, resolve2 = false) { | ||
const resolved = resolve2 ? realpathSync(path.resolve(p)) : p; | ||
function normalizePath(p, shouldResolve = false) { | ||
const resolved = shouldResolve && existsSync(p) ? realpathSync(path.resolve(p)) : p; | ||
return resolved.replace(/\\/g, "/"); | ||
@@ -42,0 +42,0 @@ } |
{ | ||
"name": "esbuild-plugin-scriptable", | ||
"description": "An ESBuild plugin for developing Scriptable iOS app scripts with TypeScript, manifest support and auto-deployment", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "scriptable", |
@@ -68,4 +68,5 @@ import {existsSync, realpathSync} from 'fs'; | ||
export function normalizePath(p: string, resolve = false): string { | ||
const resolved = resolve ? realpathSync(path.resolve(p)) : p; | ||
export function normalizePath(p: string, shouldResolve = false): string { | ||
// Only use realpathSync if the path exists and needs to be resolved | ||
const resolved = shouldResolve && existsSync(p) ? realpathSync(path.resolve(p)) : p; | ||
@@ -72,0 +73,0 @@ return resolved.replace(/\\/g, '/'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
128661
1364