@@ -2,15 +2,15 @@ import * as vscode from "vscode";
22import simpleGit from "simple-git" ;
33import filesystem from "./filesystem.service" ;
44import { createChildLogger } from "./logging.service" ;
5- import { REPOSITORY_NAME , REPOSITORY_PATH } from "../config" ;
5+ import { REPOSITORY_NAME , REPOSITORY } from "../config" ;
66
77const localLogger = createChildLogger ( "Git" ) ;
88
99export const git = simpleGit ( { trimmed : true } ) ;
1010
11- export const setupGit = async ( context : vscode . ExtensionContext ) => {
11+ export const setupGit = async ( context : vscode . ExtensionContext , storageUri : vscode . Uri ) => {
1212 const storageURI = vscode . Uri . joinPath (
13- context . globalStorageUri ,
13+ storageUri ,
1414 "addonManager"
1515 ) ;
1616 await filesystem . createDirectory ( storageURI ) ;
@@ -25,7 +25,7 @@ export const setupGit = async (context: vscode.ExtensionContext) => {
2525 `Attempting to clone ${ REPOSITORY_NAME } to ${ storageURI . fsPath } `
2626 ) ;
2727 const options = { "--depth" : 1 } ;
28- await git . clone ( REPOSITORY_PATH , storageURI . fsPath , options ) ;
28+ await git . clone ( REPOSITORY . PATH , storageURI . fsPath , options ) ;
2929 localLogger . debug (
3030 `Cloned ${ REPOSITORY_NAME } to ${ storageURI . fsPath } `
3131 ) ;
@@ -41,7 +41,7 @@ export const setupGit = async (context: vscode.ExtensionContext) => {
4141 try {
4242 await git . fetch ( ) ;
4343 await git . pull ( ) ;
44- await git . checkout ( "main" ) ;
44+ await git . checkout ( REPOSITORY . DEFAULT_BRANCH ) ;
4545 } catch ( e ) {
4646 localLogger . warn ( `Failed to pull ${ REPOSITORY_NAME } !` ) ;
4747 throw e ;
0 commit comments