@anvil-works/anvil-cli 0.3.7 → 0.3.9-canary.0
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 +8 -4
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -44733,6 +44733,9 @@ var __webpack_exports__ = {};
|
|
|
44733
44733
|
throw createGitError.commandFailed("status", e.message);
|
|
44734
44734
|
}
|
|
44735
44735
|
}
|
|
44736
|
+
function normalizeLineEndings(content) {
|
|
44737
|
+
return content.replace(/\r\n/g, "\n");
|
|
44738
|
+
}
|
|
44736
44739
|
function pythonifyName(name) {
|
|
44737
44740
|
return name.replace(/[^A-z0-9]/g, "_").replace(/^[0-9]/, "_$&");
|
|
44738
44741
|
}
|
|
@@ -47090,13 +47093,14 @@ var __webpack_exports__ = {};
|
|
|
47090
47093
|
};
|
|
47091
47094
|
}
|
|
47092
47095
|
async function readFileContent(repoPath, relativePath, stagedOnly) {
|
|
47093
|
-
|
|
47094
|
-
{
|
|
47096
|
+
let content;
|
|
47097
|
+
if (stagedOnly) {
|
|
47095
47098
|
const git = esm_default(repoPath);
|
|
47096
|
-
|
|
47099
|
+
content = await git.show([
|
|
47097
47100
|
`:${relativePath}`
|
|
47098
47101
|
]);
|
|
47099
|
-
}
|
|
47102
|
+
} else content = await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
|
|
47103
|
+
return normalizeLineEndings(content);
|
|
47100
47104
|
}
|
|
47101
47105
|
async function readBinaryFileContent(repoPath, relativePath, stagedOnly) {
|
|
47102
47106
|
if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath));
|
package/dist/index.js
CHANGED
|
@@ -19879,6 +19879,9 @@ var __webpack_exports__ = {};
|
|
|
19879
19879
|
throw createGitError.commandFailed("status", e.message);
|
|
19880
19880
|
}
|
|
19881
19881
|
}
|
|
19882
|
+
function normalizeLineEndings(content) {
|
|
19883
|
+
return content.replace(/\r\n/g, "\n");
|
|
19884
|
+
}
|
|
19882
19885
|
function pythonifyName(name) {
|
|
19883
19886
|
return name.replace(/[^A-z0-9]/g, "_").replace(/^[0-9]/, "_$&");
|
|
19884
19887
|
}
|
|
@@ -22688,13 +22691,14 @@ var __webpack_exports__ = {};
|
|
|
22688
22691
|
};
|
|
22689
22692
|
}
|
|
22690
22693
|
async function readFileContent(repoPath, relativePath, stagedOnly) {
|
|
22691
|
-
|
|
22692
|
-
{
|
|
22694
|
+
let content;
|
|
22695
|
+
if (stagedOnly) {
|
|
22693
22696
|
const git = esm_default(repoPath);
|
|
22694
|
-
|
|
22697
|
+
content = await git.show([
|
|
22695
22698
|
`:${relativePath}`
|
|
22696
22699
|
]);
|
|
22697
|
-
}
|
|
22700
|
+
} else content = await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath), "utf8");
|
|
22701
|
+
return normalizeLineEndings(content);
|
|
22698
22702
|
}
|
|
22699
22703
|
async function readBinaryFileContent(repoPath, relativePath, stagedOnly) {
|
|
22700
22704
|
if (!stagedOnly) return await external_fs_.promises.readFile(external_path_default().join(repoPath, relativePath));
|