mirror of
https://github.com/LukeHagar/sveltekit-electron-adapter.git
synced 2025-12-07 12:47:49 +00:00
[Release] v0.2.0
This commit is contained in:
23
scripts/init.ts
Normal file
23
scripts/init.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Init
|
||||
* =====================
|
||||
* Configure telegram token and username
|
||||
*
|
||||
* @contributors: Patryk Rzucidło [@ptkdev] <support@ptkdev.io> (https://ptk.dev)
|
||||
* Alì Shadman [@AliShadman95] (https://github.com/AliShadman95)
|
||||
*
|
||||
* @license: MIT License
|
||||
*
|
||||
*/
|
||||
import * as fs from "fs";
|
||||
import * as shell from "shelljs";
|
||||
import { argv } from "yargs";
|
||||
|
||||
declare const __dirname: string;
|
||||
console.log(argv, argv._[0]);
|
||||
const path = `${__dirname}/../app/configs/config.js`;
|
||||
|
||||
if (fs.existsSync(path)) {
|
||||
shell.sed("-i", "BOT_USERNAME", `${argv._[0]}`, path);
|
||||
shell.sed("-i", "BOT_TOKEN", `${argv._[1]}`, path);
|
||||
}
|
||||
Reference in New Issue
Block a user