Merge pull request #6445 from angeliski/fix-windows-build

fix windows paths
This commit is contained in:
Ben Lambert
2021-07-13 18:56:04 +02:00
committed by GitHub
4 changed files with 11 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-rails': patch
---
updated paths to consider differences between platform (windows corrected)
@@ -56,6 +56,7 @@ export type RailsRunOptions = {
export const railsArgumentResolver = (
projectRoot: string,
options: RailsRunOptions,
executionOnContainer = false,
): string[] => {
const argumentsToRun: string[] = [];
@@ -103,7 +104,7 @@ export const railsArgumentResolver = (
argumentsToRun.push(
options.template.replace(
`.${separatorPath}`,
`${projectRoot}${separatorPath}`,
`${projectRoot}${executionOnContainer ? '/' : separatorPath}`,
),
);
}
@@ -137,7 +137,7 @@ describe('Rails Templater', () => {
owner: 'angeliski',
storePath: 'https://github.com/angeliski/rails-project',
name: 'rails-project',
railsArguments: { template: './something.rb' },
railsArguments: { template: `.${path.sep}something.rb` },
imageName: 'foo/rails-custom-image',
};
@@ -210,7 +210,7 @@ describe('Rails Templater', () => {
owner: 'angeliski',
storePath: 'https://github.com/angeliski/rails-project',
name: 'rails-project',
railsArguments: { template: './something.rb' },
railsArguments: { template: `.${path.sep}something.rb` },
imageName: 'foo/rails-custom-image',
};
@@ -68,7 +68,7 @@ export class RailsNewRunner {
command: baseCommand,
args: [
...baseArguments,
`${intermediateDir}/${name}`,
`${intermediateDir}${path.sep}${name}`,
...arrayExtraArguments,
],
logStream,
@@ -77,6 +77,7 @@ export class RailsNewRunner {
const arrayExtraArguments = railsArgumentResolver(
'/input',
railsArguments as RailsRunOptions,
true,
);
await this.containerRunner.runContainer({
imageName: imageName as string,