mirror of
https://github.com/jetzig-framework/jetzig.git
synced 2025-05-14 22:16:08 +00:00

Eradication of `data` arg to requests. We no longer need to pass this value around as we have a) type inference, b) nested object insertion via `put` and `append`. Fix `joinPath` numeric type coercion Detect empty string params and treat them as blank with expectParams() Fix error logging/stack trace printing. Update Zmpl - includes debug tokens + error tracing to source template in debug builds.
46 lines
1.2 KiB
Zig
46 lines
1.2 KiB
Zig
const std = @import("std");
|
|
|
|
const cli = @import("../../cli.zig");
|
|
const util = @import("../../util.zig");
|
|
|
|
pub fn run(
|
|
allocator: std.mem.Allocator,
|
|
cwd: std.fs.Dir,
|
|
args: []const []const u8,
|
|
options: cli.database.Options,
|
|
T: type,
|
|
main_options: T,
|
|
) !void {
|
|
_ = cwd;
|
|
_ = options;
|
|
if (main_options.options.help or args.len != 0) {
|
|
std.debug.print(
|
|
\\Update a database: run migrations and reflect schema.
|
|
\\
|
|
\\Convenience wrapper for `jetzig database migrate` and `jetzig database reflect`.
|
|
\\
|
|
\\Example:
|
|
\\
|
|
\\ jetzig database update
|
|
\\ jetzig --environment=testing update
|
|
\\
|
|
, .{});
|
|
|
|
return if (main_options.options.help) {} else error.JetzigCommandError;
|
|
}
|
|
|
|
try util.runCommand(allocator, &.{
|
|
"zig",
|
|
"build",
|
|
util.environmentBuildOption(main_options.options.environment),
|
|
"jetzig:database:migrate",
|
|
});
|
|
|
|
try util.runCommand(allocator, &.{
|
|
"zig",
|
|
"build",
|
|
util.environmentBuildOption(main_options.options.environment),
|
|
"jetzig:database:reflect",
|
|
});
|
|
}
|