Skip to content

Commit

Permalink
fix: copy README.md and LICENSE just for primary entry (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
dherges authored Oct 25, 2017
1 parent 2801db9 commit 38776d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/lib/ng-packagr.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// BUILD STEP IMPLEMENTATIONS
import { discoverPackages } from './steps/package';
import { rimraf } from './util/rimraf';
import { copyFiles } from './util/copy';
import { generateNgBundle } from './bundler';
import { PackageSearchResult } from './model/package-search-result';

// Node API
import * as path from 'path';

// Logging
Expand Down Expand Up @@ -39,6 +42,9 @@ export async function createNgPackage(opts: NgPackagrCliArguments): Promise<void
await generateNgBundle(secondaryPackage);
}

await copyFiles(`${rootPackage.sourcePath}/README.md`, rootPackage.destinationPath);
await copyFiles(`${rootPackage.sourcePath}/LICENSE`, rootPackage.destinationPath);

log.success(`Built Angular library from ${rootPackage.sourcePath}, written to ${rootPackage.destinationPath}`);
} catch (error) {
// Report error messages and throw the error further up
Expand Down
3 changes: 0 additions & 3 deletions src/lib/steps/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ export async function discoverPackages(rootPath: string): Promise<PackageSearchR
export async function writePackage(ngPkg: NgPackageData, packageArtifacts: NgArtifacts): Promise<void> {

log.debug('writePackage');
await copyFiles(`${ngPkg.sourcePath}/**/*.md`, ngPkg.destinationPath);
await copyFiles(`${ngPkg.sourcePath}/LICENSE`, ngPkg.destinationPath);

const packageJson: any = await readJson(path.resolve(ngPkg.sourcePath, 'package.json'));
// set additional properties
for(const fieldName in packageArtifacts) {
Expand Down

0 comments on commit 38776d8

Please sign in to comment.