Skip to content

Commit c94e55f

Browse files
committed
fix part casesensivity
1 parent afee383 commit c94e55f

File tree

4 files changed

+77
-11
lines changed

4 files changed

+77
-11
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ Im Ordner [`public/mks/tags/`](./public/mks/tags/) findest du die Erklärungen f
4242
- [`UART.md`](./public/mks/abbr/UART.md)
4343
- ...
4444

45-
<!-- die Website folgt in etwa diesem layout
46-
![website layout](./layout_concept.svg) -->
4745

4846
## contributions
4947

@@ -54,16 +52,11 @@ dann schreibe uns bitte im [issues-tracker](https://github.com/Make-Your-School/
5452

5553
### Bauteil Spezifisch Inhalt/Code
5654

57-
wenn es ein spezifisches Bauteil betrifft, bitte im Bauteil-eigenen Repository ein issue erstellen.
55+
wenn es ein spezifisches Bauteil betrifft, bitte im Bauteil-eigenen Repository ein issue erstellen:
5856

5957
in der gerenderten Seite ist das jeweilige Bauteil-Repository ganz am Ende der Seite mit dem Text `edit source` verlinkt.
6058

61-
und wenn Du direkt eine Idee hast **wie** z.b. eine Formulierung leichter Verständlich ist, kannst du diese auch gerne als `PR` (PullRequest) vorbereiten.
62-
aktuell gibt es dazu noch keine ausführliche Dokumentation.
63-
vielleicht hilft dir die [offizielle Github Hilfe](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) auch schon weiter
64-
ansonsten gern auch hier eine Frage als Issues oder als [_Forumsbeitrag_](https://github.com/Make-Your-School/mks-welcome/discussions)
65-
66-
mehr infos dazu in [docu/contributions.md](./docu/contributions.md) (WIP)
59+
mehr infos zu diesem Prozess in [docu/contributions.md](./docu/contributions.md)
6760

6861
### Bauteil Hinzufügen
6962

src/pages/MKS_Part_Details.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ console.log('props.part_name', props.part_name)
4848
import { useMDContentStore } from 'src/stores/mdContent'
4949
const mdContent = useMDContentStore()
5050
console.log('mdContent', mdContent)
51-
const part = mdContent.mks.parts[props.part_name]
51+
const part = mdContent.mks.parts[props.part_name.toLowerCase()]
5252
console.log('part', part)
5353
5454
const mysLink = location.href

tools/setup_github_repos.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export async function main() {
149149
repoData.repo_name,
150150
repoData.description,
151151
)
152-
const homepage = `https://make-your-school.github.io/mks-welcome/part/${repoData.repo_name}`
152+
const homepage = `https://make-your-school.github.io/mks-welcome/part/${repoData.repo_name.toLowerCase}`
153153
repoSetHomepage(octokit, repoData.repo_name, homepage)
154154

155155
// console.log(`result`, result)

tools/setup_github_repos_meta.mjs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// install these:
2+
// yarn add @octokit/core
3+
// yarn add dotenv
4+
5+
// run with node setup_github_repos.mjs
6+
7+
import fs from 'node:fs'
8+
import { Octokit } from '@octokit/core'
9+
import dotenv from 'dotenv'
10+
11+
12+
import { getsubmodules } from '../getsubmodules.js'
13+
14+
// Load environment variables from .env file
15+
// dotenv.config({ path: `${localRepoPath}/tools/setup_github_repos/.env` })
16+
dotenv.config({ path: `tools/.env` })
17+
18+
19+
async function repoSetHomepage(octokit, name, homepage) {
20+
const result = await octokit.request('PATCH /repos/{owner}/{repo}', {
21+
owner: 'Make-Your-School',
22+
repo: name,
23+
name: name,
24+
homepage: homepage,
25+
// description: 'This is your first repository',
26+
// private: true,
27+
// has_issues: true,
28+
// has_projects: true,
29+
// has_wiki: true,
30+
// topics not allowed. skipping for now.
31+
// topics: 'markdown arduino library mks make-your-school',
32+
headers: {
33+
'X-GitHub-Api-Version': '2022-11-28',
34+
},
35+
})
36+
return result
37+
}
38+
39+
async function testOctokitRequest(octokit) {
40+
try {
41+
const { data } = await octokit.request('/user')
42+
console.log('data', data)
43+
} catch (error) {
44+
console.error('Error making Octokit request:', error)
45+
}
46+
}
47+
48+
export async function main() {
49+
// fixed configuration
50+
// Octokit.js
51+
// https://github.com/octokit/core.js#readme
52+
const octokit = new Octokit({
53+
auth: process.env.GITHUB_PAC,
54+
})
55+
56+
await testOctokitRequest(octokit)
57+
console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~')
58+
console.log('')
59+
console.log('')
60+
61+
const submodules = getsubmodules()
62+
console.log(`found '${submodules.length}' submodules to process..`)
63+
for (const [submodule_name, submodule] of Object.entries(submodules)) {
64+
console.log('submodule_name', submodule_name)
65+
console.log('submodule', submodule)
66+
// const homepage = `https://make-your-school.github.io/mks-welcome/part/${repoData.repo_name.toLowerCase()}`
67+
// await repoSetHomepage(octokit, repoData.repo_name, homepage)
68+
}
69+
70+
console.log('done.')
71+
}
72+
73+
main()

0 commit comments

Comments
 (0)