fix windows paths

fix #6427

Signed-off-by: Rogerio Angeliski <angeliski@hotmail.com>
This commit is contained in:
Rogerio Angeliski
2021-07-12 18:12:56 -03:00
parent 1118f33e4f
commit 91aa414b4e
3 changed files with 6 additions and 4 deletions
@@ -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,