pretty
This commit is contained in:
@@ -11,18 +11,20 @@ setConsoleTitle("Screenshot Uploader");
|
||||
|
||||
try {
|
||||
const start = Date.now();
|
||||
$`notify-send -t 1000 "Screenshot" "Uploading.."`.nothrow().catch(a => { });
|
||||
$`notify-send -t 1000 "Screenshot" "Uploading.."`
|
||||
.nothrow()
|
||||
.catch((a) => {});
|
||||
configDotenv({
|
||||
path: `${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env`
|
||||
path: `${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env`,
|
||||
});
|
||||
|
||||
const screenshotsDir = join(homedir(), "Pictures", "Screenshots");
|
||||
const files = readdirSync(screenshotsDir);
|
||||
|
||||
let latestFile = files
|
||||
.map(file => ({
|
||||
.map((file) => ({
|
||||
file,
|
||||
time: statSync(join(screenshotsDir, file)).mtime.getTime()
|
||||
time: statSync(join(screenshotsDir, file)).mtime.getTime(),
|
||||
}))
|
||||
.sort((a, b) => b.time - a.time)[0].file;
|
||||
|
||||
@@ -31,8 +33,9 @@ try {
|
||||
const url = await UploadToEZ(readFileSync(filePath));
|
||||
|
||||
execSync(`echo "${url}" | wl-copy -n`);
|
||||
execSync(`notify-send "Ekrānuzņēmums" "Attēls augšuplādēts e-z.host ${Date.now() - start}ms"`);
|
||||
execSync(
|
||||
`notify-send "Ekrānuzņēmums" "Attēls augšuplādēts e-z.host ${Date.now() - start}ms"`,
|
||||
);
|
||||
} catch (e_) {
|
||||
execSync(`notify-send "Error" "${`${e_}`}"`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user