@jacebenson/jsn 4.3.7-dev.24 → 4.3.7-dev.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacebenson/jsn",
3
- "version": "4.3.7-dev.24",
3
+ "version": "4.3.7-dev.25",
4
4
  "description": "A command-line interface for ServiceNow that follows the Unix philosophy: simple, composable, and scriptable.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,8 @@ export function normalizeMidName(name) {
28
28
  }
29
29
 
30
30
  export function buildMidRecipeUrl(releaseName) {
31
- const match = String(releaseName).match(/(\d{4})-(\d{2})-(\d{2})|(\d{2})-(\d{2})-(\d{4})/);
31
+ const matches = [...String(releaseName).matchAll(/(\d{4})-(\d{2})-(\d{2})|(\d{2})-(\d{2})-(\d{4})/g)];
32
+ const match = matches.at(-1);
32
33
  if (!match) throw new Error(`MID release name has no build date: ${releaseName}`);
33
34
  const year = match[1] || match[6];
34
35
  const month = match[2] || match[4];
@@ -131,7 +132,10 @@ export async function installDockerMidServer({
131
132
  fs.rmSync(persistedRecipeDir, { recursive: true, force: true });
132
133
  fs.cpSync(recipeDir, persistedRecipeDir, { recursive: true });
133
134
  fs.writeFileSync(composePath, composeFile({ serviceName }), { mode: 0o600 });
134
- fs.writeFileSync(path.join(installDir, '.env'), envFile({ instanceURL, username, password, displayName, releaseName }), { mode: 0o600 });
135
+ fs.chmodSync(composePath, 0o600);
136
+ const envPath = path.join(installDir, '.env');
137
+ fs.writeFileSync(envPath, envFile({ instanceURL, username, password, displayName, releaseName }), { mode: 0o600 });
138
+ fs.chmodSync(envPath, 0o600);
135
139
  if (!dockerAvailable || !runNow) {
136
140
  return {
137
141
  name: displayName,