Skip to content

Commit b80451d

Browse files
authored
chore: update no git remote warning (#526)
* chore: update no git remote warning * changeset
1 parent 8180d73 commit b80451d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.changeset/seven-wings-rule.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rock-js/provider-github': patch
3+
'@rock-js/tools': patch
4+
---
5+
6+
chore: update no git remote warning

packages/provider-github/src/lib/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export type GitHubRepoDetails = {
4343

4444
export async function detectGitHubRepoDetails(): Promise<GitHubRepoDetails> {
4545
const gitRemote = await getGitRemote();
46+
47+
if (!gitRemote) {
48+
throw new RockError(`No git remote found for GitHub repository.`);
49+
}
50+
4651
try {
4752
const { output: url } = await spawn(
4853
'git',

packages/tools/src/lib/build-cache/getBinaryPath.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ export async function getBinaryPath({
4848
const message = (error as RockError).message;
4949
const cause = (error as RockError).cause;
5050
logger.warn(
51-
`Failed to fetch cached build for ${artifactName}: \n${message}`,
52-
cause ? `\nCause: ${cause.toString()}` : '',
51+
`Remote Cache: Failed to fetch cached build for ${color.bold(
52+
artifactName,
53+
)}.
54+
Cause: ${message}${cause ? `\n${cause.toString()}` : ''}
55+
Read more: ${colorLink(
56+
'https://rockjs.dev/docs/configuration#remote-cache-configuration',
57+
)}`,
5358
);
5459
await warnIgnoredFiles(fingerprintOptions, sourceDir);
5560
logger.debug('Remote cache failure error:', error);

0 commit comments

Comments
 (0)