Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3400a6c
commit eff59eb
Showing
4 changed files
with
34 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import ora from 'ora'; | ||
import { Options } from '../types'; | ||
import { Stow } from '../services'; | ||
import { sync } from '.'; | ||
|
||
export default async function stow( | ||
options: Options = {}, | ||
packages: string[] | ||
): Promise<any> { | ||
const spinner = ora(); | ||
spinner.start(`stowing packages '${packages.join("' '")}'`); | ||
if (options.sync) await sync(options); | ||
try { | ||
spinner.start(`stowing packages '${packages.join("' '")}'`); | ||
const stow = new Stow(options); | ||
await stow.stow(packages); | ||
spinner.succeed(`stowed packages '${packages.join("' '")}'`); | ||
} catch (err) { | ||
if (err.code?.toString()?.[0] === '4') { | ||
spinner.fail(err.message); | ||
} else { | ||
throw err; | ||
} | ||
if (options.debug) throw err; | ||
spinner.fail(err.message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ export interface Options { | |
environment?: string; | ||
force?: boolean; | ||
remote?: string; | ||
sync?: boolean; | ||
} |