Skip to content

Commit 13d56ef

Browse files
committed
Add angular/angular
1 parent 94c708d commit 13d56ef

3 files changed

Lines changed: 16 additions & 18 deletions

File tree

repositories.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@
9999
},
100100
{
101101
"repository": "formio/angular",
102-
"commit": "865f42d7229d19a86cc7151cf2cb3c66880dedb5",
103-
"glob": "."
102+
"commit": "865f42d7229d19a86cc7151cf2cb3c66880dedb5"
103+
},
104+
{
105+
"repository": "angular/angular",
106+
"commit": "b275206a4944729a7bdec5132fb73d2ce8251cb9"
104107
}
105108
]

scripts/add-repository.mjs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ async function addProject() {
1414
outdent`
1515
Which repository are you going to add?
1616
Example:
17-
- prettier/prettier
18-
- https://github.com/prettier/prettier\n
17+
- prettier/prettier
18+
- https://github.com/prettier/prettier\n
1919
`,
2020
);
2121

@@ -39,14 +39,7 @@ async function addProject() {
3939
}
4040

4141
const commit = await getRepositoryCommitHash(repository);
42-
return [
43-
...repositories,
44-
{
45-
repository,
46-
commit,
47-
glob: ".",
48-
},
49-
];
42+
return [...repositories, { repository, commit }];
5043
});
5144
}
5245

scripts/utilities.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ export const REPOSITORIES_JSON_FILE = new URL(
99
);
1010

1111
export async function getRepositoryCommitHash(repository) {
12-
const { stdout } = await spawn("git", [
13-
"ls-remote",
14-
"--exit-code",
15-
`https://github.com/${repository}`,
16-
"HEAD",
17-
]);
12+
const { stdout } = await Promise.any(
13+
[
14+
`git@github.com:${repository}.git`,
15+
`https://github.com/${repository}`,
16+
].map((repository) =>
17+
spawn("git", ["ls-remote", "--exit-code", repository, "HEAD"]),
18+
),
19+
);
1820

1921
const [commit] = stdout.trim().split(/\s/);
2022
return commit;

0 commit comments

Comments
 (0)