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

Commitbe4ece3

Browse files
committed
fix commit order on init
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent52efa78 commitbe4ece3

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"@coderoad/cli",
3-
"version":"0.5.0",
3+
"version":"0.5.1",
44
"description":"A CLI to build the configuration file for Coderoad Tutorials",
55
"keywords": [
66
"coderoad",

‎src/utils/commits.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ type GetCommitOptions = {
1616

1717
exporttypeCommitLogObject={[position:string]:string[]};
1818

19-
20-
21-
exportfunctionparseCommits(logs:ListLogSummary<any>):{[hash:string]:string[]}{
19+
exportfunctionparseCommits(
20+
logs:ListLogSummary<any>
21+
):{[hash:string]:string[]}{
2222
// Filter relevant logs
2323
constcommits:CommitLogObject={};
2424
constpositions:string[]=[];
@@ -30,31 +30,31 @@ export function parseCommits(logs: ListLogSummary<any>): { [hash: string]: strin
3030

3131
if(matches&&matches.length){
3232
// Use an object of commit arrays to collect all commits
33-
const{ groups}=matches
34-
letposition
33+
const{ groups}=matches;
34+
letposition;
3535
if(groups.init){
36-
position='INIT'
36+
position="INIT";
3737
}elseif(groups.levelId&&groups.stepId){
38-
letstepType
38+
letstepType;
3939
//@deprecated Q
40-
if(!groups.stepType||['Q','T'].includes(groups.stepType)){
41-
stepType='T'// test
40+
if(!groups.stepType||["Q","T"].includes(groups.stepType)){
41+
stepType="T";// test
4242
//@deprecated A
43-
}elseif(!groups.stepType||['A','S'].includes(groups.stepType)){
44-
stepType='S'// solution
43+
}elseif(!groups.stepType||["A","S"].includes(groups.stepType)){
44+
stepType="S";// solution
4545
}
46-
position=`${groups.levelId}.${groups.stepId}:${stepType}`
46+
position=`${groups.levelId}.${groups.stepId}:${stepType}`;
4747
}elseif(groups.levelId){
48-
position=groups.levelId
48+
position=groups.levelId;
4949
}else{
50-
console.warn(`No matcher for commit "${commit.message}"`)
50+
console.warn(`No matcher for commit "${commit.message}"`);
5151
}
52-
commits[position]=[...(commits[position]||[]),commit.hash]
52+
commits[position]=[...(commits[position]||[]),commit.hash];
5353
positions.unshift(position);
5454
}else{
5555
constinitMatches=commit.message.match(/^INIT/);
5656
if(initMatches&&initMatches.length){
57-
commits.INIT=[...(commits.INIT||[]),commit.hash]
57+
commits.INIT=[commit.hash, ...(commits.INIT||[])];
5858
positions.unshift("INIT");
5959
}
6060
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp