mirror of
https://github.com/silicoflare/confidant.git
synced 2026-05-26 12:45:24 +05:30
init: inital commit
This commit is contained in:
11
scripts/build.ts
Normal file
11
scripts/build.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { $ } from "bun";
|
||||
import data from "../package.json";
|
||||
|
||||
const { version: ver } = data;
|
||||
|
||||
await $`
|
||||
rm -rf ./dist
|
||||
bun build --compile --target=bun-linux-x64 ./confidant.ts --outfile ./dist/confidant_${ver}_linux_x64
|
||||
bun build --compile --target=bun-windows-x64 ./confidant.ts --outfile ./dist/confidant_${ver}_win_x64.exe
|
||||
bun build --compile --target=bun-darwin-x64 ./confidant.ts --outfile ./dist/confidant_${ver}_darwin_x64
|
||||
`;
|
||||
22
scripts/init.ts
Normal file
22
scripts/init.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { $ } from "bun";
|
||||
import { stringy } from "../src/utils";
|
||||
import { randomBytes } from "crypto";
|
||||
import chalkTemplate from "chalk-template";
|
||||
|
||||
const envstring = `// env.ts
|
||||
const env = {
|
||||
// Re-run to get a new value
|
||||
AUTH_KEY: "${stringy(randomBytes(32))}",
|
||||
|
||||
// Re-run to get a new value
|
||||
AUTH_SALT: "${stringy(randomBytes(64))}",
|
||||
|
||||
// Can be literally anything!
|
||||
PHRASE: "May the Force be with you!",
|
||||
}
|
||||
|
||||
export default env;
|
||||
`;
|
||||
|
||||
await $`echo ${envstring} > env.ts`;
|
||||
console.log(chalkTemplate`{green env.ts initialized sucessfully!}`);
|
||||
Reference in New Issue
Block a user