@kispace-io/gs-lib 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/map-builder.js +6 -2
- package/package.json +1 -1
package/bin/map-builder.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
|
-
import { dirname as pathDirname, resolve, basename } from 'path'
|
|
4
|
+
import { dirname as pathDirname, resolve, basename, isAbsolute } from 'path'
|
|
5
5
|
import { readFileSync } from 'fs'
|
|
6
6
|
|
|
7
7
|
const __filename = fileURLToPath(import.meta.url)
|
|
@@ -79,7 +79,11 @@ const mapFileName = basename(resolvedMapFile)
|
|
|
79
79
|
let env = {}
|
|
80
80
|
if (options.envFile) {
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
// If env file path is already absolute, use it as-is
|
|
83
|
+
// Otherwise, resolve it relative to projectRoot (the .geospace file's directory)
|
|
84
|
+
const envPath = isAbsolute(options.envFile)
|
|
85
|
+
? options.envFile
|
|
86
|
+
: resolve(projectRoot, options.envFile)
|
|
83
87
|
const envContent = readFileSync(envPath, 'utf-8')
|
|
84
88
|
envContent.split('\n').forEach(line => {
|
|
85
89
|
const trimmed = line.trim()
|