Refactor to use version object #59
Enable writing safer version aware logic.
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { IProjectInformation } from '@/domain/IProjectInformation';
|
||||
import { ProjectInformation } from '@/domain/ProjectInformation';
|
||||
import { Version } from '@/domain/Version';
|
||||
|
||||
export function parseProjectInformation(
|
||||
environment: NodeJS.ProcessEnv,
|
||||
): IProjectInformation {
|
||||
const version = new Version(environment.VUE_APP_VERSION);
|
||||
return new ProjectInformation(
|
||||
environment.VUE_APP_NAME,
|
||||
environment.VUE_APP_VERSION,
|
||||
version,
|
||||
environment.VUE_APP_REPOSITORY_URL,
|
||||
environment.VUE_APP_HOMEPAGE_URL,
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ export class CodeSubstituter implements ICodeSubstituter {
|
||||
const substitute = (name: string, value: string) => args
|
||||
.addArgument(new FunctionCallArgument(name, value));
|
||||
substitute('homepage', info.homepage);
|
||||
substitute('version', info.version);
|
||||
substitute('version', info.version.toString());
|
||||
substitute('date', this.date.toUTCString());
|
||||
const compiledCode = this.compiler.compileExpressions(code, args);
|
||||
return compiledCode;
|
||||
|
||||
Reference in New Issue
Block a user