From 55dbb0ece06d17a9db7b93a0ffa274ff65298002 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 26 Jul 2018 14:42:07 +0200 Subject: Always append monorepo root path so script can be called from anywhere --- packages/monorepo-scripts/src/postpublish_utils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/monorepo-scripts/src/postpublish_utils.ts b/packages/monorepo-scripts/src/postpublish_utils.ts index 37861f0dd..77def309e 100644 --- a/packages/monorepo-scripts/src/postpublish_utils.ts +++ b/packages/monorepo-scripts/src/postpublish_utils.ts @@ -96,7 +96,7 @@ export const postpublishUtils = { const notes = postpublishUtils.getReleaseNotes(packageName, version); const releaseName = postpublishUtils.getReleaseName(packageName, version); const tag = postpublishUtils.getTag(packageName, version); - postpublishUtils.adjustAssetPaths(cwd, assets); + postpublishUtils.adjustAssetPaths(assets); utils.log('POSTPUBLISH: Releasing ', releaseName, '...'); await publishReleaseAsync({ token: constants.githubPersonalAccessToken, @@ -145,10 +145,12 @@ export const postpublishUtils = { const releaseName = `${subPackageName} v${version}`; return releaseName; }, - adjustAssetPaths(cwd: string, assets: string[]): string[] { + // Asset paths should described from the monorepo root. This method prefixes + // the supplied path with the absolute path to the monorepo root. + adjustAssetPaths(assets: string[]): string[] { const finalAssets: string[] = []; _.each(assets, (asset: string) => { - finalAssets.push(`${cwd}/${asset}`); + finalAssets.push(`${constants.monorepoRootPath}/${asset}`); }); return finalAssets; }, -- cgit v1.2.3