-
Notifications
You must be signed in to change notification settings - Fork 2
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite in TS/JS #80
Comments
I know I mentioned this before, but I've since improved the "deno_wrapper" project: https://github.com/jcbhmr/deno_wrapper
|
Won't it be longer code-wise? 🤔 Most of the stuff in this problem space is just going to be running bash commands in series, right? There's not a whole lot of string processing, output inspection, if checks, etc. There's only four spots where I can see logic that's not just a literal sequence of shell commands 😂 Lines 6 to 13 in 1181a52
Lines 28 to 34 in 1181a52
Lines 47 to 50 in 1181a52
Lines 101 to 108 in 1181a52
What I'm getting at is that I don't entirely know why this is being rewritten in JS/TS when it's just going to be: const inputIgnore = core.getInput("ignore")
const inputToken = core.getInput("token")
process.env.GITHUB_TOKEN = inputToken
// More code
try {
await $`gh auth setup-git`
await $`git clone ${process.env.GITHUB_SERVER_URL}${inputRepository}.wiki.git ${process.env.GIT_DIR}`
await fsPromises.writeFile(join(process.env.GIT_DIR, ".git/info/exclude"), inputIgnore)
// More git shell commands
} catch {
rimraf(process.env.GIT_DIR)
} ButIf there's some feature that you're planning on adding, that's cool and interesting! Like for instance auto preprocessing the markdown like https://github.com/impresscms-dev/strip-markdown-extensions-from-links-action/blob/main/src/index.ts ⬅ That's the cool stuff that needs Node.js to work well! Shell commands in a sequence... not really. But that's my opinion. 🤷♀️ |
I find TS easier to contribute to, and also I think it's easier to write tests. That's my basic reasoning. Also, I think the language looks prettier 🙃 |
Sounds awesome! More tests is always better! 🎉 |
Thought you might be interested to know that I have dog-fooded my own thing! 😊 https://github.com/jcbhmr/set-secrets-action |
Interesting idea! I've repeated secrets among multiple repos sometimes, could be handy 👍 |
Turns out that https://github.com/Andrew-Chen-Wang/github-wiki-action needed the push to TS after all. Andrew-Chen-Wang/github-wiki-action#68 With Andrew-Chen-Wang/github-wiki-action#8 you need an AST parser, and JavaScript has Markdown parsers in spades. I used a modified https://github.com/jcbhmr/deno_wrapper script Just figured you might be interested 😉 |
See #66 (comment)
The text was updated successfully, but these errors were encountered: