Support env vars, line endings, add glob ignore patterns, clean up deps
This commit is contained in:
parent
e0f2286a3c
commit
b83031e3e6
13 changed files with 683 additions and 224 deletions
18
frontend/local-client-cli/src/path-utils.ts
Normal file
18
frontend/local-client-cli/src/path-utils.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import * as path from "path";
|
||||
|
||||
// Convert a native platform path to forward slashes (no-op on non-Windows)
|
||||
export function toUnixPath(nativePath: string): string {
|
||||
return nativePath.split(path.sep).join(path.posix.sep);
|
||||
}
|
||||
|
||||
// Match a file path against a glob pattern
|
||||
// Extends path.matchesGlob so that "dir/**" also matches the directory itself
|
||||
export function matchesGlob(filePath: string, pattern: string): boolean {
|
||||
if (
|
||||
pattern.endsWith("/**") &&
|
||||
filePath === pattern.slice(0, -3)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return path.matchesGlob(filePath, pattern);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue