Bob Farrell 405762504d WIP
2024-11-09 17:13:32 +00:00

40 lines
1.1 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(
\\Drop database.
\\
\\Example:
\\
\\ jetzig database migrate
\\ jetzig --environment=testing database migrate
\\
\\To drop a production database, set the environment variable `{s}` to the name of the database you want to drop, e.g.:
\\
\\ {0s}=my_production_production jetzig --environment=production database drop
, .{cli.database.confirm_drop_env});
return if (main_options.options.help) {} else error.JetzigCommandError;
}
try util.execCommand(allocator, &.{
"zig",
"build",
util.environmentBuildOption(main_options.options.environment),
"jetzig:database:drop",
});
}