Skip to content

Commit

Permalink
add more options to rails new
Browse files Browse the repository at this point in the history
Signed-off-by: Rogerio Angeliski <angeliski@hotmail.com>
  • Loading branch information
angeliski committed Dec 15, 2021
1 parent 22354ee commit fc8fc02
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-humans-hope.md
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-rails': patch
---

Add new options to rails new (force and skipTests)
Expand Up @@ -96,6 +96,16 @@ export function createFetchRailsAction(options: {
description: "Don't run Webpack install",
type: 'boolean',
},
skipTest: {
title: 'skipTest',
description: 'Skip test files',
type: 'boolean',
},
force: {
title: 'force',
description: 'Overwrite files that already exist',
type: 'boolean',
},
api: {
title: 'api',
description: 'Preconfigure smaller stack for API only apps',
Expand Down
Expand Up @@ -27,6 +27,8 @@ describe('railsArgumentResolver', () => {
[{ api: true }, ['--api']],
[{ skipBundle: true }, ['--skip-bundle']],
[{ skipWebpackInstall: true }, ['--skip-webpack-install']],
[{ skipTest: true }, ['--skip-test']],
[{ force: true }, ['--force']],
[{ webpacker: 'vue' }, ['--webpack', 'vue']],
[{ database: 'postgresql' }, ['--database', 'postgresql']],
[{ railsVersion: 'dev' }, ['--dev']],
Expand Down
Expand Up @@ -51,6 +51,8 @@ export type RailsRunOptions = {
railsVersion?: RailsVersion;
skipBundle?: boolean;
skipWebpackInstall?: boolean;
skipTest?: boolean;
force?: boolean;
};

export const railsArgumentResolver = (
Expand All @@ -76,6 +78,14 @@ export const railsArgumentResolver = (
argumentsToRun.push('--skip-webpack-install');
}

if (options?.skipTest) {
argumentsToRun.push('--skip-test');
}

if (options?.force) {
argumentsToRun.push('--force');
}

if (
options?.webpacker &&
Object.values(Webpacker).includes(options?.webpacker as Webpacker)
Expand Down

0 comments on commit fc8fc02

Please sign in to comment.