ice/scripts/publishedInfo.ts

12 lines
473 B
TypeScript
Raw Normal View History

import path from 'path';
2022-01-27 15:51:02 +08:00
import fse from 'fs-extra';
2022-01-27 14:32:38 +08:00
// Set and get published packages info
const PACKAGE_TEMP_FILE = 'publishedPackages.temp.json';
export function setPublishedPackages(publishedPackages: string[]): void {
2022-01-27 15:51:02 +08:00
fse.writeFileSync(path.join(process.cwd(), PACKAGE_TEMP_FILE), JSON.stringify(publishedPackages));
2022-01-27 14:32:38 +08:00
}
export function getPublishedPackages(): string[] {
2022-01-27 15:51:02 +08:00
return JSON.parse(fse.readFileSync(path.join(process.cwd(), PACKAGE_TEMP_FILE), 'utf-8'));
2022-01-27 14:32:38 +08:00
}