Skip to content

Commit

Permalink
fix(tag), save app artifacts into the objects on Windows (#8504)
Browse files Browse the repository at this point in the history
We use `globby` package to resolve paths from the artifacts definition.
The `app-bundle` artifact has `'artifacts/app-bundle'` pattern on
linux/mac but `artifacts//app-bundle` on Windows.
Turns out that globby [doesn't support Windows
paths](sindresorhus/globby#179). This PR
changes the paths to Linux before sending to globby.
  • Loading branch information
davidfirst committed Feb 7, 2024
1 parent 89f3ea4 commit e490690
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class ComponentCompareUI {
return (
<ComponentCompare
{...(props || {})}
tabs={tabs}
tabs={tabs} // @ts-ignore
routes={routes}
host={host}
isFullScreen={props?.isFullScreen ?? true}
Expand Down
4 changes: 3 additions & 1 deletion scopes/pipelines/builder/artifact/artifact-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import globby from 'globby';
import { flatten } from 'lodash';
import { ArtifactFiles } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';
import { Component, ComponentMap } from '@teambit/component';
import { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';
import { ArtifactDefinition } from './artifact-definition';
import { DefaultResolver } from '../storage';
import { ArtifactList } from './artifact-list';
Expand All @@ -17,7 +18,8 @@ export type ArtifactMap = ComponentMap<ArtifactList<FsArtifact>>;
export class ArtifactFactory {
resolvePaths(root: string, def: ArtifactDefinition): string[] {
const patternsFlattened = flatten(def.globPatterns);
const paths = globby.sync(patternsFlattened, { cwd: root });
const patternsFlattenedLinux = patternsFlattened.map(pathNormalizeToLinux);
const paths = globby.sync(patternsFlattenedLinux, { cwd: root });
return paths;
}

Expand Down

0 comments on commit e490690

Please sign in to comment.