Skip to content

Commit c717cf5

Browse files
committed
fix: npm outdated not work
1 parent 6dd2ee5 commit c717cf5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/commands/outdated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default async(options: OutdatedOptions = {}) => {
1414
const project = await Project.load(cwd)
1515
const repo = await project.getTemplateRepo()
1616

17-
if (await repo.isVerioning()) {
17+
if (!await repo.isVerioning()) {
1818
throw new Error('`mili outdated` cannot check the template without version control')
1919
} else if (await repo.isLatest()) {
2020
logger.info('Congratulations, the current template is the latest version.')

tests/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ test('Integration testing', async t => {
3737

3838
await update({ cwd })
3939
await check({ cwd, showDiff: true, fold: true })
40+
})
41+
42+
await t.throwsAsync(async() => {
43+
const cwd = join(__dirname, '../demo')
44+
await fs.emptyDir(cwd)
45+
const repository = relative(process.cwd(), join(__dirname, './test-template'))
46+
47+
await init({ cwd, repository: `./${repository}` })
4048
await outdated({ cwd })
4149
})
4250

0 commit comments

Comments
 (0)