Skip to content

Commit

Permalink
resolved type resolution error
Browse files Browse the repository at this point in the history
  • Loading branch information
karmaniverous committed Jun 1, 2024
1 parent de0cfc5 commit 334510f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ import aliasPlugin, { Alias } from '@rollup/plugin-alias';
import commonjsPlugin from '@rollup/plugin-commonjs';
import jsonPlugin from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import terserPlugin from '@rollup/plugin-terser';
import typescriptPlugin from '@rollup/plugin-typescript';
import fs from 'fs-extra';
import type { InputOptions, OutputOptions, RollupOptions } from 'rollup';
import type { InputOptions, RollupOptions } from 'rollup';
import dtsPlugin from 'rollup-plugin-dts';

import { packageName } from './src/util/packageName';

const outputPath = `dist`;

const commonPlugins = [
Expand Down
9 changes: 4 additions & 5 deletions src/generateGetDotenvCli/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { type Scripts } from './GetDotenvCliOptions';

export const resolveCommand = (scripts: Scripts | undefined, command: string) =>
(scripts && _.isObject(scripts[command])
? scripts[command].cmd
? (scripts[command] as Exclude<Scripts[string], string>).cmd
: scripts?.[command] ?? command) as string;

export const resolveShell = (
scripts: Scripts | undefined,
command: string,
shell: string | boolean | undefined,
) =>
(scripts && _.isObject(scripts[command]) ? scripts[command].shell : shell) as
| string
| boolean
| undefined;
scripts && _.isObject(scripts[command])
? (scripts[command] as Exclude<Scripts[string], string>).shell
: shell;

0 comments on commit 334510f

Please sign in to comment.