This is important for users that always use --localTs, which means that
they never run the code that creates the cache directory as part of
installing old versions of typescript.
This commit is contained in:
Nathan Shively-Sanders 2019-08-26 13:17:09 -07:00 коммит произвёл GitHub
Родитель 5e6411f72a
Коммит 02911ca10e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -10,6 +10,7 @@ type SourceFile = TsType.SourceFile;
// Based on https://github.com/danvk/typings-checker
const cacheDir = join(os.homedir(), ".dts");
const perfDir = join(os.homedir(), ".dts", "perf");
export class Rule extends Lint.Rules.TypedRule {
@ -59,6 +60,9 @@ export class Rule extends Lint.Rules.TypedRule {
memory: ts.sys.getMemoryUsage ? ts.sys.getMemoryUsage() : 0,
},
};
if (!existsSync(cacheDir)) {
mkdirSync(cacheDir);
}
if (!existsSync(perfDir)) {
mkdirSync(perfDir);
}