File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import tutorialConfig from '../actions/tutorialConfig'
99import { COMMANDS } from '../editor/commands'
1010import logger from '../services/logger'
1111import Context from './context'
12- import { version as gitVersion } from '../services/git '
12+ import { version } from '../services/dependencies '
1313import { openWorkspace , checkWorkspaceEmpty } from '../services/workspace'
1414import { readFile } from 'fs'
1515import { join } from 'path'
@@ -146,7 +146,7 @@ class Channel implements Channel {
146146 }
147147 // 2. check Git is installed.
148148 // Should wait for workspace before running otherwise requires access to root folder
149- const isGitInstalled = await gitVersion ( )
149+ const isGitInstalled = await version ( 'git' )
150150 if ( ! isGitInstalled ) {
151151 const error : E . ErrorMessage = {
152152 type : 'GitNotFound' ,
Original file line number Diff line number Diff line change @@ -69,19 +69,6 @@ export async function clear(): Promise<Error | void> {
6969 throw new Error ( 'Error cleaning up current unsaved work' )
7070}
7171
72- export async function version ( ) : Promise < string | null > {
73- const { stdout, stderr } = await node . exec ( 'git --version' )
74- if ( ! stderr ) {
75- const match = stdout . match ( / ^ g i t v e r s i o n ( \d + \. ) ? ( \d + \. ) ? ( \* | \d + ) / )
76- if ( match ) {
77- // eslint-disable-next-line
78- const [ _ , major , minor , patch ] = match
79- return `${ major } ${ minor } ${ patch } `
80- }
81- }
82- return null
83- }
84-
8572async function init ( ) : Promise < Error | void > {
8673 const { stderr } = await node . exec ( 'git init' )
8774 if ( stderr ) {
You can’t perform that action at this time.
0 commit comments