@fellas/adonisjs-resque
Version:
Resque Queue for AdonisJS v6
35 lines (34 loc) • 1.07 kB
JavaScript
import {
stubsRoot
} from "../chunk-MZLOY7HF.js";
import "../chunk-ASV6JZ7C.js";
import {
__decorateClass
} from "../chunk-EUXUH3YW.js";
// commands/make_job.ts
import { BaseCommand, args } from "@adonisjs/core/ace";
import StringBuilder from "@poppinss/utils/string_builder";
var MakeJob = class extends BaseCommand {
static commandName = "make:job";
static description = "Make a new job class";
static options = {
startApp: true
};
async run() {
const codemods = await this.createCodemods();
const jobName = new StringBuilder(this.name).removeExtension().removeSuffix("service").removeSuffix("model").singular().pascalCase().toString();
const jobFileName = new StringBuilder(jobName).snakeCase().ext(".ts").toString();
await codemods.makeUsingStub(stubsRoot, "make/job/job.stub", {
flags: this.parsed.flags,
jobName,
jobFileName
});
}
};
__decorateClass([
args.string({ description: "Name of the job file" })
], MakeJob.prototype, "name", 2);
export {
MakeJob as default
};
//# sourceMappingURL=make_job.js.map