Bugs and tweaks to Terminal

This commit is contained in:
Dustin Brett
2022-09-05 20:32:13 -07:00
parent 7dd5028c3e
commit 8249e90272
2 changed files with 19 additions and 3 deletions

View File

@@ -148,9 +148,15 @@ const useCommandInterpreter = (
break;
}
case "cd":
case "cd/":
case "cd.":
case "cd..":
case "chdir":
case "pwd": {
const [directory] = commandArgs;
const [directory] =
lcBaseCommand.startsWith("cd") && lcBaseCommand.length > 2
? [lcBaseCommand.slice(2)]
: commandArgs;
if (directory && lcBaseCommand !== "pwd") {
const fullPath = await getFullPath(directory);
@@ -546,7 +552,17 @@ const useCommandInterpreter = (
if (await exists(fullSourcePath)) {
if (destination) {
const fullDestinationPath = await getFullPath(destination);
let fullDestinationPath = await getFullPath(destination);
if (
["move", "mv"].includes(lcBaseCommand) &&
(await stat(fullDestinationPath)).isDirectory()
) {
fullDestinationPath = join(
fullDestinationPath,
basename(fullSourcePath)
);
}
await rename(fullSourcePath, fullDestinationPath);
updateFile(fullSourcePath, true);

View File

@@ -34,7 +34,7 @@ export const convert = async (
returnFiles.push([
join(dirname(fileName), newName),
image.blob
image?.blob
? Buffer.from(await image.blob.arrayBuffer())
: Buffer.from(""),
]);