@jrmc/adonis-attachment
Version:
Turn any field on your Lucid model to an attachment data type
29 lines (28 loc) • 1.3 kB
JavaScript
/**
* @jrmc/adonis-attachment
*
* @license MIT
* @copyright Jeremy Chaufourier <jeremy@chaufourier.fr>
*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { stubsRoot } from '../../stubs/main.js';
import { args, BaseCommand } from '@adonisjs/core/ace';
export default class MakeConverter extends BaseCommand {
static commandName = 'make:converter';
static description = 'Create a new media converter class';
stubPath = 'make/converter/main.stub';
async run() {
const codemods = await this.createCodemods();
await codemods.makeUsingStub(stubsRoot, this.stubPath, {
name: this.name,
});
}
}
__decorate([
args.string({ description: 'The name of the converter' })
], MakeConverter.prototype, "name", void 0);