Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiaCode authored Oct 19, 2023
1 parent 61e1cf6 commit 84c5116
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions crates/kurit-js/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,12 @@ const args = Kurit.args.slice(1) // kurit [subcommand] [...args]

switch (args[0]) { // SubCommands
case 'build':
if (!(args.length === 2)) { // args not found
console.error('SubCommand Not Found')
break
}
switch (args[1]) { // multi file support
case 'md':
{ // scope
const path = args[2]
const filename = path.substring(path.lastIndexOf('/')+1).replace('.md', '')
const contents = Kurit.md_to_html(filename, await Kurit.fs.readFile(path))
await Kurit.fs.writeFile(path.replace('.md', '.html'), contents)
console.log('Finish...🚀')
}
break
default:
break
{
const path = args[1]
const filename = path.substring(path.lastIndexOf('/')+1).replace('.md', '')
const contents = Kurit.md_to_html(filename, await Kurit.fs.readFile(path))
await Kurit.fs.writeFile(path.replace('.md', '.html'), contents)
console.log('Finish...🚀')
}
break
case 'serve':
Expand Down Expand Up @@ -49,4 +39,4 @@ Commands:
version - Kurit Version
about - Kurit About
`)
}
}

0 comments on commit 84c5116

Please sign in to comment.