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

Commitd652457

Browse files
committed
support multiple reset commands
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentada2f6a commitd652457

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

‎src/actions/onRunReset.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as TT from 'typings/tutorial'
33
importContextfrom'../services/context/context'
44
import{exec}from'../services/node'
55
importresetfrom'../services/reset'
6+
import*ashooksfrom'../services/hooks'
67
importgetCommitHashByPositionfrom'../services/reset/lastHash'
78

89
typeResetAction={
@@ -29,9 +30,12 @@ const onRunReset = async (action: ResetAction, context: Context): Promise<void>
2930
// load timeline until last pass commit
3031
reset({ branch, hash})
3132

33+
// TODO:@deprecate command in favor of commands
3234
// if tutorial.config.reset.command, run it
3335
if(tutorial?.config?.reset?.command){
34-
awaitexec({command:tutorial.config.reset.command})
36+
hooks.onReset([tutorial?.config?.reset?.command])
37+
}elseif(tutorial?.config?.reset?.commands){
38+
hooks.onReset(tutorial?.config?.reset?.commands)
3539
}
3640
}
3741

‎src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as TT from 'typings/tutorial'
33
import*asvscodefrom'vscode'
44
importcreateTestRunnerfrom'./services/testRunner'
55
importcreateWebViewfrom'./services/webview'
6-
importloggerfrom'./services/logger'
76
import*ashooksfrom'./services/hooks'
7+
importloggerfrom'./services/logger'
88

99
exportconstCOMMANDS={
1010
START:'coderoad.start',

‎src/services/hooks/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export const onSolutionEnter = async (actions: TT.StepActions): Promise<void> =>
3838
awaitonRunTest()
3939
}
4040

41+
exportconstonReset=async(commands:string[]):Promise<void>=>{
42+
awaitrunCommands(commands)
43+
}
44+
4145
exportconstonError=async(error:Error):Promise<void>=>{
4246
telemetryOnError(error)
4347
}

‎typings/tutorial.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export type Maybe<T> = T | null
44

55
exporttypeConfigReset={
66
command?:string
7+
commands?:string[]
78
}
89

910
exporttypeTutorialConfig={

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp