Don't set outputs if empty or nil

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-09-24 17:22:41 +02:00
parent bf8ce2e8a5
commit 6bbb1022a9
2 changed files with 10 additions and 2 deletions

View File

@@ -14,7 +14,11 @@ export async function getMetadata(): Promise<string | undefined> {
if (!fs.existsSync(metadataFile)) {
return undefined;
}
return fs.readFileSync(metadataFile, {encoding: 'utf-8'});
const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
if (content === 'null') {
return undefined;
}
return content;
}
export async function isAvailable(): Promise<Boolean> {