Skip to content

Commit

Permalink
fix: update web root
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Apr 25, 2024
1 parent dc6b784 commit 6a694ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/check-project/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async function processMonorepo (projectDir, manifest, branchName, repoUrl, ciFil
}

const projectDirs = []
const webRoot = `${repoUrl}/tree/${branchName}`

for (const subProjectDir of await getSubprojectDirectories(projectDir, workspaces)) {
const stat = await fs.stat(subProjectDir)
Expand All @@ -128,7 +129,7 @@ async function processMonorepo (projectDir, manifest, branchName, repoUrl, ciFil
}

const pkg = fs.readJSONSync(manfest)
const homePage = `${repoUrl}/tree/${branchName}${subProjectDir.substring(projectDir.length)}`
const homePage = `${webRoot}/${subProjectDir.includes(projectDir) ? subProjectDir.substring(projectDir.length) : subProjectDir}`

console.info('Found monorepo project', pkg.name)

Expand All @@ -143,8 +144,6 @@ async function processMonorepo (projectDir, manifest, branchName, repoUrl, ciFil
let proposedManifest = await monorepoManifest(manifest, repoUrl, repoUrl, branchName)
proposedManifest = sortManifest(proposedManifest)

const webRoot = `${repoUrl}/tree/${branchName}`

await ensureFileHasContents(projectDir, 'package.json', JSON.stringify(proposedManifest, null, 2))
await ensureFileHasContents(projectDir, '.gitignore', fs.readFileSync(path.join(__dirname, 'files', 'gitignore'), {
encoding: 'utf-8'
Expand Down

0 comments on commit 6a694ec

Please sign in to comment.