Skip to content

Commit

Permalink
feat(lm): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
keiko713 committed Dec 7, 2020
1 parent e8f6b8d commit caa2936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/commands/lm/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Command } = require('@oclif/command')
const showHelp = require('../../utils/show-help')
const { isEmptyCommand } = require('../../utils/check-command-inputs')
const showHelp = require('../../utils/show-help')

class LmCommand extends Command {
async run() {
Expand All @@ -19,8 +19,8 @@ The lm command will help you manage a large media for the site
`
LmCommand.examples = [
'netlify lm:info',
// 'netlify lm:install',
// 'netlify lm:setup'
// 'netlify lm:install',
// 'netlify lm:setup'
]

LmCommand.hidden = true
Expand Down
2 changes: 1 addition & 1 deletion src/commands/lm/info.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { Command } = require('@oclif/command')
const Listr = require('listr')
const chalk = require('chalk')
const Listr = require('listr')
const {
GitValidators,
checkLFSFilters,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/lm/requirements.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ async function checkGitVersion() {
async function checkLFSVersion() {
try {
const result = await execa('git-lfs', ['--version'])
return matchVersion(result.stdout, /git-lfs\/([\.\d]+).*/, '2.5.1', 'Invalid Git LFS version. Please update to version 2.5.1 or above')
return matchVersion(result.stdout, /git-lfs\/([.\d]+).*/, '2.5.1', 'Invalid Git LFS version. Please update to version 2.5.1 or above')
} catch (error) {
throw new Error('Check that Git LFS is installed in your system')
}
}

function matchVersion(out, regex, version, message) {
const match = out.match(regex)
if (!match || match.length != 2 || semver.lt(match[1], version)) {
if (!match || match.length !== 2 || semver.lt(match[1], version)) {
throw new Error(message)
}
return match[1]
Expand Down

0 comments on commit caa2936

Please sign in to comment.