[Release] v0.2.0

This commit is contained in:
Patryk Rzucidlo (PTKDev)
2023-02-11 01:11:16 +01:00
parent abbcd24b5f
commit 770dea9257
81 changed files with 18255 additions and 701 deletions

33
scripts/githash.ts Normal file
View File

@@ -0,0 +1,33 @@
import Logger from "@ptkdev/logger";
import fs from "fs";
import path from "path";
import { execSync } from "child_process";
import semver from "../package.json";
const gitdotfile = `${__dirname}/../.git/config`;
const logger = new Logger();
let branch = "";
let hash = "";
const execSyncWrapper = (command: string) => {
let stdout = "";
try {
stdout = execSync(command).toString().trim();
} catch (error) {
logger.error(JSON.stringify(error));
}
return stdout;
};
if (fs.existsSync(gitdotfile)) {
branch = execSyncWrapper("git rev-parse --abbrev-ref HEAD");
hash = execSyncWrapper("git rev-parse --short=7 HEAD");
}
const obj = {
semver: semver.version.split("-")[0],
branch,
hash,
};
fs.writeFileSync(path.resolve("app/configs", "version.json"), JSON.stringify(obj, null, "\t"));