import path from 'path'; import fs from 'fs-extra'; /** * Initialize a Squeebot environment * @param name Environment name * @param location Install path */ export async function newEnvironment( name?: string, location?: string ): Promise { if (!name) { name = 'squeebot'; } if (!location) { location = name; } location = path.resolve(process.cwd(), location); const envFile = path.join(location, name + '.json'); await fs.ensureDir(location); await fs.writeJson(envFile, { environment: 'production', path: location, }); console.log('\nNew environment file:\t', envFile); console.log('Environment path:\t', location); }