datagrok-tools 6.1.3 → 6.1.4
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/bin/commands/publish.js +9 -2
- package/package.json +1 -1
package/bin/commands/publish.js
CHANGED
|
@@ -125,13 +125,20 @@ function calculateFolderHash(dirPath) {
|
|
|
125
125
|
entries.sort((a, b) => a.relPath < b.relPath ? -1 : a.relPath > b.relPath ? 1 : 0);
|
|
126
126
|
for (const entry of entries) {
|
|
127
127
|
if (entry.isDir) {
|
|
128
|
+
color.log(` Hash entry: dir:${entry.relPath}:`);
|
|
128
129
|
hash.update(`dir:${entry.relPath}:`);
|
|
129
130
|
} else {
|
|
131
|
+
// Normalize CRLF to LF to match server-side storage
|
|
132
|
+
const raw = _fs.default.readFileSync(entry.fullPath);
|
|
133
|
+
const content = raw.includes(0x0d) && !raw.includes(0x00) ? Buffer.from(raw.toString('utf8').replace(/\r\n/g, '\n'), 'utf8') : raw;
|
|
134
|
+
color.log(` Hash entry: file:${entry.relPath}: (${content.length} bytes)`);
|
|
130
135
|
hash.update(`file:${entry.relPath}:`);
|
|
131
|
-
hash.update(
|
|
136
|
+
hash.update(content);
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
|
-
|
|
139
|
+
const result = hash.digest('hex');
|
|
140
|
+
color.log(` Folder hash: ${result}`);
|
|
141
|
+
return result;
|
|
135
142
|
}
|
|
136
143
|
function listRecursive(basePath, rel) {
|
|
137
144
|
const results = [];
|
package/package.json
CHANGED