fix: update version number to 2.2.5 in package.json and enhance file reading logic in push command

This commit is contained in:
Space-Banane
2026-04-01 17:24:42 +02:00
parent e953466786
commit 3fe3dc96da
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "shsf-cli", "name": "shsf-cli",
"version": "2.2.4", "version": "2.2.5",
"description": "", "description": "",
"type": "module", "type": "module",
"files": [ "files": [
+11 -3
View File
@@ -79,9 +79,17 @@ export const pushDefinition = {
); );
const currentFiles = currentFilesResponse.data.data; // Expecting { name: string, id: string [...] }[] const currentFiles = currentFilesResponse.data.data; // Expecting { name: string, id: string [...] }[]
const files = fs.readdirSync(options.from).map((file) => ({ // Read local files and filter to only include files (exclude directories)
filename: file, const files = fs
content: fs.readFileSync(path.join(options.from, file), "utf-8"), .readdirSync(options.from)
.map((file) => {
const filePath = path.join(options.from, file);
return { filename: file, filePath };
})
.filter(({ filePath }) => fs.statSync(filePath).isFile())
.map(({ filename, filePath }) => ({
filename,
content: fs.readFileSync(filePath, "utf-8"),
})); }));
if (!options.force && files.length > 5) { if (!options.force && files.length > 5) {