mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Fix some greptile things
This commit is contained in:
parent
7a3e991a2d
commit
f94f7d9fc8
@ -16,8 +16,8 @@ export async function execCommandCountLines(
|
||||
) {
|
||||
const process = execaCommand(command, { shell: true, buffer: false, ...options });
|
||||
if (!process.stdout) {
|
||||
// Return undefined rather than throwing an error
|
||||
return undefined;
|
||||
// eslint-disable-next-line local-rules/no-uncategorized-errors
|
||||
throw new Error('Unexpected missing stdout');
|
||||
}
|
||||
|
||||
let lineCount = 0;
|
||||
@ -29,5 +29,7 @@ export async function execCommandCountLines(
|
||||
// If the process errors, this will throw
|
||||
await process;
|
||||
|
||||
rl.close();
|
||||
|
||||
return lineCount;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import { expect, it } from 'vitest';
|
||||
|
||||
import { getHasRouterPackage } from './get-has-router-package';
|
||||
|
||||
it('returns true if there is a routing package in package.json', async () => {
|
||||
it('returns true if there is a routing package in package.json', () => {
|
||||
expect(
|
||||
getHasRouterPackage({
|
||||
dependencies: {
|
||||
@ -14,7 +14,7 @@ it('returns true if there is a routing package in package.json', async () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('returns false if there is a routing package in package.json dependenices', async () => {
|
||||
it('returns false if there is a routing package in package.json dependencies', () => {
|
||||
expect(
|
||||
getHasRouterPackage({
|
||||
dependencies: {
|
||||
|
@ -16,7 +16,10 @@ export const runTelemetryOperation = async <T>(cacheKey: string, operation: () =
|
||||
let cached = await cache.get<T>(cacheKey);
|
||||
if (cached === undefined) {
|
||||
cached = await operation();
|
||||
await cache.set(cacheKey, cached);
|
||||
// Undefined indicates an error, setting isn't really valuable.
|
||||
if (cached !== undefined) {
|
||||
await cache.set(cacheKey, cached);
|
||||
}
|
||||
}
|
||||
return cached;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user