@jira-deploy/core 1.0.12 → 1.0.13

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.
@@ -1,4 +1,6 @@
1
1
  import { readFileSync } from 'fs';
2
+ import { homedir } from 'os';
3
+ import { join } from 'path';
2
4
 
3
5
  const EMPTY_OBJECT = Object.freeze({});
4
6
 
@@ -148,10 +150,17 @@ function deepMerge(base, override) {
148
150
  return merged;
149
151
  }
150
152
 
153
+ function expandHomePath(filePath) {
154
+ if (filePath === '~') return homedir();
155
+ if (filePath.startsWith('~/')) return join(homedir(), filePath.slice(2));
156
+ return filePath;
157
+ }
158
+
151
159
  function loadExternalConfig() {
152
160
  if (process.env.JIRA_DEPLOY_CONFIG_PATH) {
161
+ const configPath = expandHomePath(process.env.JIRA_DEPLOY_CONFIG_PATH);
153
162
  return parseJsonConfig(
154
- readFileSync(process.env.JIRA_DEPLOY_CONFIG_PATH, 'utf8'),
163
+ readFileSync(configPath, 'utf8'),
155
164
  `JIRA_DEPLOY_CONFIG_PATH (${process.env.JIRA_DEPLOY_CONFIG_PATH})`,
156
165
  );
157
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jira-deploy/core",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "repository": {
@@ -42,6 +42,6 @@
42
42
  "dotenv": "^16.3.0"
43
43
  },
44
44
  "scripts": {
45
- "test": "node --import ./test-env.js --test tools.test.js tools/jabber.test.js"
45
+ "test": "node --import ./test-env.js --test tools.test.js tools/jabber.test.js config.test.js"
46
46
  }
47
47
  }