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

fix commit order on init#67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 1 commit intomasterfromfix/commit-order
Aug 2, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix commit order on init
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
  • Loading branch information
@ShMcK
ShMcK committedAug 2, 2020
commitbe4ece3b7d7d94eebbe448b4a86f8d1489e0ca4f
2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
{
"name": "@coderoad/cli",
"version": "0.5.0",
"version": "0.5.1",
"description": "A CLI to build the configuration file for Coderoad Tutorials",
"keywords": [
"coderoad",
Expand Down
32 changes: 16 additions & 16 deletionssrc/utils/commits.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,9 +16,9 @@ type GetCommitOptions = {

export type CommitLogObject = { [position: string]: string[] };



export function parseCommits(logs: ListLogSummary<any>): { [hash: string]: string[]} {
export function parseCommits(
logs: ListLogSummary<any>
): { [hash: string]: string[]} {
// Filter relevant logs
const commits: CommitLogObject = {};
const positions: string[] = [];
Expand All@@ -30,31 +30,31 @@ export function parseCommits(logs: ListLogSummary<any>): { [hash: string]: strin

if (matches && matches.length) {
// Use an object of commit arrays to collect all commits
const { groups } = matches
let position
const { groups } = matches;
let position;
if (groups.init) {
position ='INIT'
position ="INIT";
} else if (groups.levelId && groups.stepId) {
let stepType
let stepType;
// @deprecated Q
if (!groups.stepType || ['Q', 'T'].includes(groups.stepType)) {
stepType ='T' // test
if (!groups.stepType || ["Q", "T"].includes(groups.stepType)) {
stepType ="T"; // test
// @deprecated A
} else if (!groups.stepType || ['A', 'S'].includes(groups.stepType)) {
stepType ='S' // solution
} else if (!groups.stepType || ["A", "S"].includes(groups.stepType)) {
stepType ="S"; // solution
}
position = `${groups.levelId}.${groups.stepId}:${stepType}`
position = `${groups.levelId}.${groups.stepId}:${stepType}`;
} else if (groups.levelId) {
position = groups.levelId
position = groups.levelId;
} else {
console.warn(`No matcher for commit "${commit.message}"`)
console.warn(`No matcher for commit "${commit.message}"`);
}
commits[position] = [...(commits[position] || []), commit.hash]
commits[position] = [...(commits[position] || []), commit.hash];
positions.unshift(position);
} else {
const initMatches = commit.message.match(/^INIT/);
if (initMatches && initMatches.length) {
commits.INIT = [...(commits.INIT || []), commit.hash]
commits.INIT = [commit.hash, ...(commits.INIT || [])];
positions.unshift("INIT");
}
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp