Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit176d24a

Browse files
committed
have git use version fn
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent21a0ff0 commit176d24a

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

‎src/channel/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import tutorialConfig from '../actions/tutorialConfig'
99
import{COMMANDS}from'../editor/commands'
1010
importloggerfrom'../services/logger'
1111
importContextfrom'./context'
12-
import{versionasgitVersion}from'../services/git'
12+
import{version}from'../services/dependencies'
1313
import{openWorkspace,checkWorkspaceEmpty}from'../services/workspace'
1414
import{readFile}from'fs'
1515
import{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-
constisGitInstalled=awaitgitVersion()
149+
constisGitInstalled=awaitversion('git')
150150
if(!isGitInstalled){
151151
consterror:E.ErrorMessage={
152152
type:'GitNotFound',

‎src/services/git/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ export async function clear(): Promise<Error | void> {
6969
thrownewError('Error cleaning up current unsaved work')
7070
}
7171

72-
exportasyncfunctionversion():Promise<string|null>{
73-
const{ stdout, stderr}=awaitnode.exec('git --version')
74-
if(!stderr){
75-
constmatch=stdout.match(/^gitversion(\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-
returnnull
83-
}
84-
8572
asyncfunctioninit():Promise<Error|void>{
8673
const{ stderr}=awaitnode.exec('git init')
8774
if(stderr){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp