Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,14 @@ export default class Session {
cli.setExitCode(1);
}
if (!upstream) {
cli.warn('You need to configure the remote repository for Node.js core.');
cli.warn('You have not told git-node what remote name you are trying to land commits on.');
cli.separator();
cli.info(
'1. First, add the Node.js core repository as a remote (if not already added):\n' +
const remoteName = runSync('git', ['remote', '-v'])
.match(/^(\S+)\s+(?:https:\/\/github\.com\/|git@github\.com:)nodejs\/node\.git \(\S+\)\r?$/m)?.[1];
cli.info(remoteName
? `You likely want to run the following:\n\n $ ncu-config set upstream ${remoteName}`
: 'The expected repository does not seem to appear in your local config.\n' +
'1. First, add the Node.js core repository as a remote:\n' +
' $ git remote add upstream https://github.com/nodejs/node.git\n\n' +
'2. Then, tell git-node to use this remote for syncing:\n' +
' $ ncu-config set upstream upstream\n\n' +
Expand Down
Loading