Support additional sticker states

Co-authored-by: scott@signal.org
Co-authored-by: ken@signal.org
This commit is contained in:
Ken Powers 2019-05-23 18:27:42 -07:00 committed by Scott Nonnenberg
parent 41880cfe66
commit be5d0837f8
35 changed files with 925 additions and 249 deletions

View file

@ -20,6 +20,8 @@ import mkdirp from 'mkdirp';
import rimraf from 'rimraf';
import { app, BrowserWindow, dialog } from 'electron';
import { getTempPath } from '../../app/attachments';
// @ts-ignore
import * as packageJson from '../../package.json';
import { getSignatureFileName } from './signature';
@ -269,7 +271,7 @@ function getGotOptions(): GotOptions<null> {
function getBaseTempDir() {
// We only use tmpdir() when this code is run outside of an Electron app (as in: tests)
return app ? join(app.getPath('userData'), 'temp') : tmpdir();
return app ? getTempPath(app.getPath('userData')) : tmpdir();
}
export async function createTempDir() {
@ -303,11 +305,6 @@ export function getPrintableError(error: Error) {
return error && error.stack ? error.stack : error;
}
export async function deleteBaseTempDir() {
const baseTempDir = getBaseTempDir();
await rimrafPromise(baseTempDir);
}
export function getCliOptions<T>(options: any): T {
const parser = createParser({ options });
const cliOptions = parser.parse(process.argv);