Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use GMT time, add path parameter, add named export. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import write from "./src/lib/write";

// Generate `build` object
const build: Build = {};

const path = args.path || "src/build.ts" ;
build.version = await version();
build.timestamp = new Date().toString();
build.timestamp = new Date().toUTCString();
build.message =
args.message || (args.message === "" ? await message() : null);
build.git = args.noGit
Expand All @@ -35,7 +35,7 @@ import write from "./src/lib/write";
};

// Write Build information to file
await write(build);
await write(build, path);

console.log("");
signale.success("Saved Build Information");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-build-info",
"version": "2.0.1",
"version": "2.0.2",
"description": "🛠 A CLI to generate an easily importable `build.ts` file containing various details about the application build",
"main": "index.js",
"bin": {
Expand Down
5 changes: 5 additions & 0 deletions src/lib/arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const args = yargs(process.argv)
type: "string",
description: "Specify a build message",
})
.option("path", {
alias: "p",
type: "string",
description: "Path for build.ts",
})
.option("no-git", {
alias: "g",
type: "boolean",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const write = async (content: Build, path?: string): Promise<void> => {
await fs.writeFile(
writePath,
"// Build information, automatically generated by `ng-info`\n" +
"const build = " +
"export const build = " +
JSON.stringify(content, null, 4).replace(
/\"([^(\")"]+)\":/g,
"$1:"
Expand Down