diff --git a/src/build/build.v b/src/build/build.v index f2ff9af..6f2b0a8 100644 --- a/src/build/build.v +++ b/src/build/build.v @@ -3,12 +3,10 @@ module build import docker import encoding.base64 import time -import json -import server import env import net.http -import cli import git +import json const container_build_dir = '/build' diff --git a/src/build/cli.v b/src/build/cli.v index a32a6e7..463d2ca 100644 --- a/src/build/cli.v +++ b/src/build/cli.v @@ -3,6 +3,7 @@ module build import cli import env +// cmd returns the cli submodule that handles the build process pub fn cmd() cli.Command { return cli.Command{ name: 'build' diff --git a/src/env.v b/src/env.v index 62678e6..58c6803 100644 --- a/src/env.v +++ b/src/env.v @@ -100,6 +100,3 @@ pub fn load(path string) ?T { } return res } - -pub fn load_with_file(path string) ?T { -} diff --git a/src/git/cli.v b/src/git/cli.v index 6030612..17fa984 100644 --- a/src/git/cli.v +++ b/src/git/cli.v @@ -9,6 +9,7 @@ struct Config { api_key string [required] } +// cmd returns the cli submodule that handles the repos API interaction pub fn cmd() cli.Command { return cli.Command{ name: 'repos' diff --git a/src/git/git.v b/src/git/git.v index 597aa3c..913bc39 100644 --- a/src/git/git.v +++ b/src/git/git.v @@ -9,6 +9,7 @@ pub: branch string [required] } +// read_repos reads the given JSON file & parses it as a list of Git repos pub fn read_repos(path string) ?[]GitRepo { if !os.exists(path) { mut f := os.create(path) ? @@ -27,6 +28,7 @@ pub fn read_repos(path string) ?[]GitRepo { return res } +// write_repos writes a list of repositories back to a given file pub fn write_repos(path string, repos []GitRepo) ? { mut f := os.create(path) ? diff --git a/src/main.v b/src/main.v index 18a822b..11bc77b 100644 --- a/src/main.v +++ b/src/main.v @@ -2,9 +2,7 @@ module main import os import server -import util import cli -import env import build import git diff --git a/src/server/cli.v b/src/server/cli.v index 367878a..6e67686 100644 --- a/src/server/cli.v +++ b/src/server/cli.v @@ -3,6 +3,7 @@ module server import cli import env +// cmd returns the cli submodule that handles starting the server pub fn cmd() cli.Command { return cli.Command{ name: 'server' diff --git a/src/server/git.v b/src/server/git.v index 2e014db..3ec8eeb 100644 --- a/src/server/git.v +++ b/src/server/git.v @@ -1,8 +1,6 @@ module server import web -import os -import json import git const repos_file = 'repos.json' diff --git a/src/server/server.v b/src/server/server.v index 7f129e9..0738bc4 100644 --- a/src/server/server.v +++ b/src/server/server.v @@ -6,7 +6,6 @@ import log import repo import env import util -import cli const port = 8000