@anvil-works/anvil-cli 0.3.8 → 0.3.9

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/dist/cli.js CHANGED
@@ -44744,6 +44744,9 @@ var __webpack_exports__ = {};
44744
44744
  throw createGitError.commandFailed("status", e.message);
44745
44745
  }
44746
44746
  }
44747
+ function normalizeLineEndings(content) {
44748
+ return content.replace(/\r\n/g, "\n");
44749
+ }
44747
44750
  function pythonifyName(name) {
44748
44751
  return name.replace(/[^A-z0-9]/g, "_").replace(/^[0-9]/, "_$&");
44749
44752
  }
@@ -47107,13 +47110,14 @@ var __webpack_exports__ = {};
47107
47110
  };
47108
47111
  }
47109
47112
  async function readFileContent(repoPath, relativePath, stagedOnly) {
47110
- if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
47111
- {
47113
+ let content;
47114
+ if (stagedOnly) {
47112
47115
  const git = esm_default(repoPath);
47113
- return await git.show([
47116
+ content = await git.show([
47114
47117
  `:${relativePath}`
47115
47118
  ]);
47116
- }
47119
+ } else content = await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
47120
+ return normalizeLineEndings(content);
47117
47121
  }
47118
47122
  async function readBinaryFileContent(repoPath, relativePath, stagedOnly) {
47119
47123
  if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath));
package/dist/index.js CHANGED
@@ -19890,6 +19890,9 @@ var __webpack_exports__ = {};
19890
19890
  throw createGitError.commandFailed("status", e.message);
19891
19891
  }
19892
19892
  }
19893
+ function normalizeLineEndings(content) {
19894
+ return content.replace(/\r\n/g, "\n");
19895
+ }
19893
19896
  function pythonifyName(name) {
19894
19897
  return name.replace(/[^A-z0-9]/g, "_").replace(/^[0-9]/, "_$&");
19895
19898
  }
@@ -22705,13 +22708,14 @@ var __webpack_exports__ = {};
22705
22708
  };
22706
22709
  }
22707
22710
  async function readFileContent(repoPath, relativePath, stagedOnly) {
22708
- if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
22709
- {
22711
+ let content;
22712
+ if (stagedOnly) {
22710
22713
  const git = esm_default(repoPath);
22711
- return await git.show([
22714
+ content = await git.show([
22712
22715
  `:${relativePath}`
22713
22716
  ]);
22714
- }
22717
+ } else content = await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
22718
+ return normalizeLineEndings(content);
22715
22719
  }
22716
22720
  async function readBinaryFileContent(repoPath, relativePath, stagedOnly) {
22717
22721
  if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvil-works/anvil-cli",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "CLI tool for developing Anvil apps locally",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",