@pmate/cli 0.24.40 → 0.24.41
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 +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16398,10 +16398,13 @@ async function archiveMessageImages(rootDir, sourceKey, threadKey, messages2) {
|
|
|
16398
16398
|
);
|
|
16399
16399
|
}
|
|
16400
16400
|
async function archiveMessageImage(rootDir, attachmentRoot, threadKey, imagePath) {
|
|
16401
|
-
if (!imagePath || isExternalImageRef(imagePath)
|
|
16401
|
+
if (!imagePath || isExternalImageRef(imagePath)) {
|
|
16402
16402
|
return imagePath;
|
|
16403
16403
|
}
|
|
16404
16404
|
const normalized = import_node_path18.default.posix.normalize(imagePath.replace(/\\/g, "/"));
|
|
16405
|
+
if (normalized.startsWith("attachments/")) {
|
|
16406
|
+
return import_node_path18.default.join(rootDir, ...normalized.split("/"));
|
|
16407
|
+
}
|
|
16405
16408
|
if (normalized.startsWith("../") || import_node_path18.default.posix.isAbsolute(normalized)) {
|
|
16406
16409
|
return imagePath;
|
|
16407
16410
|
}
|
|
@@ -16411,7 +16414,7 @@ async function archiveMessageImage(rootDir, attachmentRoot, threadKey, imagePath
|
|
|
16411
16414
|
try {
|
|
16412
16415
|
await import_node_fs13.promises.mkdir(import_node_path18.default.dirname(destinationPath), { recursive: true });
|
|
16413
16416
|
await import_node_fs13.promises.copyFile(sourcePath, destinationPath);
|
|
16414
|
-
return
|
|
16417
|
+
return destinationPath;
|
|
16415
16418
|
} catch {
|
|
16416
16419
|
return imagePath;
|
|
16417
16420
|
}
|