Skip to content

Commit

Permalink
move templates module to project/templates
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Jan 28, 2024
1 parent 57ba2a0 commit 42e1663
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions cmd/src/tools/cmd_new.ri
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
// source code is governed by an MIT license that can be found in the LICENSE
// file.

import std/{
import std/{
flag, semver, strings, console, process, fs.{self, Path, Directory}
};
import rivet/utils;

import ./{templates, project.*};
import ./{project.*, project/templates};

var new_desc := "Sets up a new Rivet project and performs `git init` (if `git` is installed
on the system).";
Expand Down
19 changes: 19 additions & 0 deletions cmd/src/tools/project/templates/main_file.ri
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (C) 2023-2024 Jose Mendoza - All rights reserved. Use of this
// source code is governed by an MIT license that can be found in the LICENSE
// file.

pub var main_file := "import std/console;
func main() {
console.writeln(\"Hello World!\");
}
";

pub var lib_file := "pub func add(a: int32, b: int32) -> int32 {
return a + b;
}
test \"test `add` function\" {
@assert(add(2, 2) == 4);
}
";
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
// source code is governed by an MIT license that can be found in the LICENSE
// file.

pub var main_file := "import std/console;
func main() {
console.writeln(\"Hello World!\");
}
";

pub var lib_file := "pub func add(a: int32, b: int32) -> int32 {
return a + b;
}
test \"test `add` function\" {
@assert(add(2, 2) == 4);
}
";

pub var git_ignore_file := "# Binaries for programs and plugins
{}
*.exe
Expand Down

0 comments on commit 42e1663

Please sign in to comment.