@halospv3/hce.shared-config
Version:
Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.
29 lines (21 loc) • 673 B
text/typescript
import { existsSync } from 'node:fs';
import { basename, isAbsolute, resolve } from 'node:path';
/**
* Known properties. Additional properties may be added upon request.
*/
export class MSBuildProjectProperties {
[Property: string]: string;
FullPath = '';
TargetFramework = '';
TargetFrameworks = '';
RuntimeIdentifier = '';
RuntimeIdentifiers = '';
constructor(fullPath: string, exists = true) {
this.FullPath = fullPath;
if (!isAbsolute(this.FullPath)) this.FullPath = resolve(this.FullPath);
if (!existsSync(this.FullPath) && exists)
throw new Error(
`Project ${basename(this.FullPath)} could not be found at "${this.FullPath}"`,
);
}
}