Skip to content

Commit

Permalink
Remove unnecassary functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Aug 20, 2023
1 parent c21e098 commit df1e46b
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 605 deletions.
135 changes: 0 additions & 135 deletions src/builder

This file was deleted.

5 changes: 4 additions & 1 deletion src/compile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const AUTH_TOKEN := "pELerETRaVeYHEne"
const ENDPOINT_URL := "https://api.thelang.io"

fn request (url: str, path: str) buffer_Buffer {
data := fs_readFileSync(path)
data := zip.zip(path)

headers := [
request_Header{name: "authorization", value: AUTH_TOKEN},
request_Header{name: "content-type", value: "application/octet-stream"}
Expand All @@ -17,6 +18,8 @@ fn request (url: str, path: str) buffer_Buffer {
res := req.read()
req.close()

fs_removeFileSync(path)

if res.status != 200 {
print(res.data.str(), to: "stderr")
process_exit(1)
Expand Down
21 changes: 1 addition & 20 deletions src/main
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ main {
.usage("the [options]")
.usage("the <command> file [options]")

.command(
"build",
"Build source directory into single file",
default: "."
)
.command("compile", "Compile file")
.command("install", "Add package to your project", alias: "i")
.command("lex", "Lex file")
Expand All @@ -34,11 +29,6 @@ main {
hasValue: false
)

.option(
"build-dir",
"Build output directory, by default \"build\"",
default: "build"
)
.option("compiler", "Offline compiler to use instead of cloud servers")
.option("exclude", "Exclude paths separated by comma")
.option("help", "Print help information", alias: "h", hasValue: false)
Expand All @@ -63,7 +53,6 @@ main {

.example("the -h")
.example("the --version")
.example("the build")
.example("the compile /path/to/file")
.example("the lex /path/to/file")
.example("the compile /path/to/file --the=1.0")
Expand All @@ -77,7 +66,6 @@ main {

mut action := ""
mut actionArgument := ""
mut buildDir := ""
mut compiler := ""
mut excludePaths := [".git", ".svn", "thumbs.db", ".DS_Store"]
mut outputPath := ""
Expand All @@ -89,7 +77,6 @@ main {
arg := args.data[i]

if (
arg.command == "build" ||
arg.command == "compile" ||
arg.command == "install" ||
arg.command == "lex" ||
Expand All @@ -106,8 +93,6 @@ main {
action = arg.command
} elif arg.option == "help" || arg.option == "version" {
action = arg.option
} elif arg.option == "build-dir" {
buildDir = arg.value
} elif arg.option == "compiler" {
compiler = arg.value
} elif arg.option == "exclude" {
Expand All @@ -131,8 +116,6 @@ main {
}
}

excludePaths.push(buildDir)

if action == "help" {
print(args.help(), terminator: "")
process_exit(0)
Expand All @@ -145,9 +128,7 @@ main {

qs := "?v=" + version + "&p=" + platform

if action == "build" {
Builder_init(actionArgument, buildDir, excludePaths)
} elif action == "compile" || action == "lex" || action == "parse" {
if action == "compile" || action == "lex" || action == "parse" {
command(compiler, action, actionArgument, outputPath, qs)
} elif action == "install" || action == "uninstall" || action == "update" {
mut packager := Packager_init()
Expand Down
Loading

0 comments on commit df1e46b

Please sign in to comment.