fix: update version number to 2.2.5 in package.json and enhance file reading logic in push command
This commit is contained in:
+1
-1
@@ -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": [
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user