1 | export * from '../node_modules/tslib/tslib';
|
2 | import { CommandlineArgument, ShortCommandlineArgument } from './types';
|
3 | import Args from 'vamtiger-argv/build/main';
|
4 | import postinstallDistTags from './postinstall-dist-tag';
|
5 | import postinstallCopy from './postinstall-copy';
|
6 |
|
7 | const { cwd } = process;
|
8 | const workingDirectory = cwd();
|
9 | const args = new Args();
|
10 | const distTag = args.get(CommandlineArgument.distTag) || args.get(CommandlineArgument.distTag);
|
11 | const copy = args.has(CommandlineArgument.copy) || args.has(CommandlineArgument.copy);
|
12 | const sourceFolder = args.get(CommandlineArgument.sourceFolder) || args.get(CommandlineArgument.sourceFolder);
|
13 | const pattern = args.get(CommandlineArgument.pattern) || args.get(CommandlineArgument.pattern);
|
14 | const copyParams = copy && sourceFolder && pattern && sourceFolder !== workingDirectory && {
|
15 | workingDirectory,
|
16 | sourceFolder,
|
17 | pattern
|
18 | };
|
19 |
|
20 |
|
21 | if (distTag) {
|
22 | postinstallDistTags({ workingDirectory, distTag })
|
23 | .catch(console.warn);
|
24 | } else if (copyParams) {
|
25 | postinstallCopy(copyParams)
|
26 | .catch(console.warn);
|
27 | } |
\ | No newline at end of file |