@aspruyt/xfg 1.0.1 → 1.0.3

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.
@@ -88,7 +88,15 @@ export function convertContentToString(content, fileName, options) {
88
88
  doc.commentBefore = headerComment;
89
89
  }
90
90
  }
91
- return stringify(doc, { indent: 2 });
91
+ // Quote all string values for YAML 1.1 compatibility.
92
+ // The yaml library outputs YAML 1.2 where "06:00" is a plain string,
93
+ // but many tools (e.g., Dependabot) use YAML 1.1 parsers that interpret
94
+ // unquoted values like "06:00" as sexagesimal (360) or "yes"/"no" as booleans.
95
+ return stringify(doc, {
96
+ indent: 2,
97
+ defaultStringType: "QUOTE_DOUBLE",
98
+ defaultKeyType: "PLAIN",
99
+ });
92
100
  }
93
101
  if (format === "json5") {
94
102
  // JSON5 format - output standard JSON (which is valid JSON5)
package/dist/git-ops.d.ts CHANGED
@@ -34,8 +34,9 @@ export declare class GitOps {
34
34
  createBranch(branchName: string): Promise<void>;
35
35
  writeFile(fileName: string, content: string): void;
36
36
  /**
37
- * Marks a file as executable in git using update-index --chmod=+x.
38
- * This modifies the file mode in git's index, not the filesystem.
37
+ * Marks a file as executable both on the filesystem and in git's index.
38
+ * - Filesystem: Uses chmod to set 755 permissions (rwxr-xr-x)
39
+ * - Git index: Uses update-index --chmod=+x so the mode is committed
39
40
  * @param fileName - The file path relative to the work directory
40
41
  */
41
42
  setExecutable(fileName: string): Promise<void>;
package/dist/git-ops.js CHANGED
@@ -1,4 +1,4 @@
1
- import { rmSync, existsSync, mkdirSync, writeFileSync, readFileSync, } from "node:fs";
1
+ import { rmSync, existsSync, mkdirSync, writeFileSync, readFileSync, chmodSync, } from "node:fs";
2
2
  import { join, resolve, relative, isAbsolute, dirname } from "node:path";
3
3
  import { escapeShellArg } from "./shell-utils.js";
4
4
  import { defaultExecutor } from "./command-executor.js";
@@ -77,8 +77,9 @@ export class GitOps {
77
77
  writeFileSync(filePath, normalized, "utf-8");
78
78
  }
79
79
  /**
80
- * Marks a file as executable in git using update-index --chmod=+x.
81
- * This modifies the file mode in git's index, not the filesystem.
80
+ * Marks a file as executable both on the filesystem and in git's index.
81
+ * - Filesystem: Uses chmod to set 755 permissions (rwxr-xr-x)
82
+ * - Git index: Uses update-index --chmod=+x so the mode is committed
82
83
  * @param fileName - The file path relative to the work directory
83
84
  */
84
85
  async setExecutable(fileName) {
@@ -86,7 +87,9 @@ export class GitOps {
86
87
  return;
87
88
  }
88
89
  const filePath = this.validatePath(fileName);
89
- // Use relative path from workDir for git command
90
+ // Set filesystem permissions (755 = rwxr-xr-x)
91
+ chmodSync(filePath, 0o755);
92
+ // Also update git's index so the executable bit is committed
90
93
  const relativePath = relative(this.workDir, filePath);
91
94
  await this.exec(`git update-index --add --chmod=+x ${escapeShellArg(relativePath)}`, this.workDir);
92
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspruyt/xfg",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool to sync JSON or YAML configuration files across multiple GitHub and Azure DevOps repositories",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",