-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaoc.strategy.js
20 lines (18 loc) · 1.07 KB
/
aoc.strategy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function aocStrategy (repo, startwd) {
const repowd = `${startwd}/repos/${repo}`
const steps = [
{ command: `git clone git@github.com:${repo}.git repos/${repo}`, cwd: startwd },
{ command: 'pwd', cwd: repowd },
{ command: 'echo "\ninput.txt" >> .gitignore', cwd: repowd, startwd },
{ command: 'echo "\nexample.txt" >> .gitignore', cwd: repowd, startwd },
{ command: 'echo "\ntes*.txt" >> .gitignore', cwd: repowd, startwd },
{ command: 'git add .gitignore', cwd: repowd, startwd },
{ command: 'git commit -m "Ignore input.txt based on AoC license restrictions"', cwd: repowd, startwd },
{ command: 'git filter-repo --path-glob **/input.txt --invert-paths --force', cwd: repowd, startwd },
{ command: 'git filter-repo --path-glob **/example.txt --invert-paths --force', cwd: repowd, startwd },
{ command: 'git filter-repo --path-glob **/tes*.txt --invert-paths --force', cwd: repowd, startwd },
{ command: `git push --set-upstream git@github.com:${repo}.git main --force`, cwd: repowd, startwd }
]
return steps
}
module.exports = aocStrategy