bsky-cli 1.0.1 → 1.0.2
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
|
@@ -56580,16 +56580,19 @@ var SUPPORTED_IMAGE_TYPES = {
|
|
|
56580
56580
|
".webp": "image/webp",
|
|
56581
56581
|
".gif": "image/gif"
|
|
56582
56582
|
};
|
|
56583
|
+
function unescapeShellText(text) {
|
|
56584
|
+
return text.replace(/\\!/g, "!").replace(/\\\$/g, "$").replace(/\\`/g, "`").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
|
|
56585
|
+
}
|
|
56583
56586
|
async function readPostText(text) {
|
|
56584
56587
|
if (text) {
|
|
56585
|
-
return text;
|
|
56588
|
+
return unescapeShellText(text);
|
|
56586
56589
|
}
|
|
56587
56590
|
if (!process.stdin.isTTY) {
|
|
56588
56591
|
const chunks = [];
|
|
56589
56592
|
for await (const chunk of process.stdin) {
|
|
56590
56593
|
chunks.push(chunk);
|
|
56591
56594
|
}
|
|
56592
|
-
return Buffer.concat(chunks).toString("utf8").trim();
|
|
56595
|
+
return unescapeShellText(Buffer.concat(chunks).toString("utf8").trim());
|
|
56593
56596
|
}
|
|
56594
56597
|
throw new Error('No post text provided. Use: bsky post "text" or echo "text" | bsky post');
|
|
56595
56598
|
}
|