UNPKG

@serverless-dev/s

Version:

Serverless devs tool, serverless developer tool, supports Alibaba cloud, AWS, azure, baidu cloud, Huawei cloud, Google cloud and Tencent cloud.

20 lines (17 loc) 426 B
import * as os from 'os'; import * as path from 'path'; import * as fs from 'fs-extra'; export function getHomeDir() : string { const home = path.join(os.homedir(), '.s'); if (!fs.existsSync(home)) { fs.mkdirSync(home); } return home; } export function getHistoryFile() : string { const file = path.join(getHomeDir(), 'history'); if (!fs.existsSync(file)) { fs.createFileSync(file); } return file; }