@@ -18,7 +18,7 @@ import * as opn from "opn"
1818import { config , IConfig } from "./visreg.config" ;
1919
2020export const f = "./.github-token" ;
21- export const repoUrl = url . parse ( `https://${ config . githubHostname } /${ config . githubName } /${ config . repo } ` ) ;
21+ export const repoUrl = url . parse ( `https://${ config . githubHostname } /${ config . githubUsername } /${ config . repo } ` ) ;
2222export const hasCommitRegex = / \[ .* ( [ 0 - 9 a - f ] { 7 } ) ] C h e c k i n g i n s c r e e n s h o t s .../ ;
2323
2424export function validateVPN ( githubHostname : string ) {
@@ -47,19 +47,11 @@ export async function checkConfig() {
4747 const updateTs = / n a m e 1 2 3 4 / . test ( dataTs ) ;
4848
4949 if ( updateJs || updateTs ) {
50- const defaultUsername = "your sso" ;
5150 const options : IOptions = {
52- default : defaultUsername ,
53- message : "Github Enterprise username?" ,
51+ message : "Github username?" ,
5452 } ;
5553
5654 const name = await input ( options . message , options ) as string ;
57- if ( name === defaultUsername ) {
58- console . log ( `Visit ${ config . githubHostname } and log in to make sure this works.` ) ;
59- console . log ( "After logging in, copy the last part of the url on your homepage. It's likely your sso." ) ;
60- throw new Error ( "Please enter a valid Github Enterprise username." ) ;
61- }
62-
6355 const js = dataJs . replace ( / n a m e 1 2 3 4 / , name ) ;
6456 updateJs && fs . writeFileSync ( javascriptConfig , js ) ;
6557
@@ -152,7 +144,7 @@ export function createDiff(token: string, currentBranch: string, screenshotsDire
152144}
153145
154146export function pushBranch ( token : string , repoUrl : url . Url , branch : string , screenshotsDirectory : string ) {
155- let pushUrl = `https://${ token } @${ repoUrl . hostname } /${ config . githubName } /${ config . repo } .git` ;
147+ let pushUrl = `https://${ token } @${ repoUrl . hostname } /${ config . githubUsername } /${ config . repo } .git` ;
156148 console . log ( `Generating remote screenshot diff...` ) ;
157149 safeExecSync ( token , `cd ${ screenshotsDirectory } ; git push ${ pushUrl } ${ branch } > /dev/null 2>&1` ) ;
158150} ;
@@ -254,7 +246,7 @@ export function resetRepository(screenshotsDirectory: string) {
254246 if ( fs . existsSync ( `${ screenshotsDirectory } /.git` ) ) {
255247 // check the current remote in case it's been updated
256248 const remote = child_process . execSync ( `cd ${ screenshotsDirectory } ; git remote -v | head -n 1` ) . toString ( ) ;
257- const remoteRegex = new RegExp ( `\bgit@${ config . githubHostname } :${ config . githubName } /${ config . repo } .git\b` ) ;
249+ const remoteRegex = new RegExp ( `\bgit@${ config . githubHostname } :${ config . githubUsername } /${ config . repo } .git\b` ) ;
258250 if ( ! remoteRegex . test ( remote ) ) {
259251 console . log ( "Updated screenshots repository detected -- cleaning." ) ;
260252 cmd ( "npm run clean:screenshots" ) ;
0 commit comments