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

Commit2183755

Browse files
committed
target user folder with remove file
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent4641fdb commit2183755

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

‎src/channel/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import { openWorkspace, checkWorkspaceEmpty } from '../services/workspace'
1818
import{showOutput}from'../services/testRunner/output'
1919
import{exec}from'../services/node'
2020
import{WORKSPACE_ROOT,TUTORIAL_URL}from'../environment'
21-
importresetfrom'../services/git/reset'
22-
importgetLastCommitHashfrom'../services/git/lastHash'
21+
importresetfrom'../services/reset'
22+
importgetLastCommitHashfrom'../services/reset/lastHash'
2323

2424
constreadFileAsync=promisify(readFile)
2525

@@ -330,8 +330,15 @@ class Channel implements Channel {
330330
// get last pass commit
331331
consthash=getLastCommitHash(position,tutorial?.levels||[])
332332

333+
constbranch=tutorial?.config.repo.branch
334+
335+
if(!branch){
336+
console.error('No repo branch found for tutorial')
337+
return
338+
}
339+
333340
// load timeline until last pass commit
334-
reset({branch:tutorial?.config.repo.branch, hash})
341+
reset({ branch, hash})
335342

336343
// if tutorial.config.reset.command, run it
337344
if(tutorial?.config?.reset?.command){

‎src/services/node/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { promisify } from 'util'
55
import{WORKSPACE_ROOT}from'../../environment'
66

77
constasyncExec=promisify(cpExec)
8+
constasyncRemoveFile=promisify(fs.unlink)
89

910
interfaceExecParams{
1011
command:string
@@ -19,3 +20,7 @@ export const exec = (params: ExecParams): Promise<{ stdout: string; stderr: stri
1920
exportconstexists=(...paths:string[]):boolean|never=>{
2021
returnfs.existsSync(join(WORKSPACE_ROOT, ...paths))
2122
}
23+
24+
exportconstremoveFile=(...paths:string[])=>{
25+
returnasyncRemoveFile(join(WORKSPACE_ROOT, ...paths))
26+
}

‎src/services/git/reset.tsrenamed to‎src/services/reset/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import*asfsfrom'fs'
2-
import{promisify}from'util'
3-
import{exec}from'../node'
4-
5-
constremoveFile=promisify(fs.unlink)
1+
import{exec,removeFile}from'../node'
62

73
interfaceInput{
84
hash:string
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp