@stacksjs/storage 0.59.4 → 0.59.6
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/index.js +4 -0
- package/package.json +1 -1
- package/src/hash.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -188,6 +188,10 @@ var folders = {
|
|
|
188
188
|
import {createHash} from "crypto";
|
|
189
189
|
import {path as p2} from "@stacksjs/path";
|
|
190
190
|
function hashFileOrDirectory(path4, hash) {
|
|
191
|
+
if (!fs.existsSync(path4)) {
|
|
192
|
+
console.error(`Path does not exist: ${path4}`);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
191
195
|
if (fs.statSync(path4).isDirectory()) {
|
|
192
196
|
const files2 = fs.readdirSync(path4);
|
|
193
197
|
for (const file of files2) {
|
package/package.json
CHANGED
package/src/hash.ts
CHANGED
|
@@ -4,6 +4,13 @@ import { path as p } from '@stacksjs/path'
|
|
|
4
4
|
import { fs } from './fs'
|
|
5
5
|
|
|
6
6
|
export function hashFileOrDirectory(path: string, hash: Hash): void {
|
|
7
|
+
// Check if the path exists before proceeding
|
|
8
|
+
if (!fs.existsSync(path)) {
|
|
9
|
+
console.error(`Path does not exist: ${path}`)
|
|
10
|
+
// Handle the non-existent path as needed (e.g., skip or log)
|
|
11
|
+
return
|
|
12
|
+
}
|
|
13
|
+
|
|
7
14
|
if (fs.statSync(path).isDirectory()) {
|
|
8
15
|
const files = fs.readdirSync(path)
|
|
9
16
|
for (const file of files) {
|