Skip to content

Commit

Permalink
adding lgtm code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sc committed Feb 9, 2022
1 parent 88a2098 commit 7e2da14
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![npm](https://img.shields.io/npm/v/bash-converter)](https://www.npmjs.com/package/bash-converter)
[![Coverage Status](https://coveralls.io/repos/github/daniel-sc/bash-shell-to-bat-converter/badge.svg?branch=master)](https://coveralls.io/github/daniel-sc/bash-shell-to-bat-converter?branch=master)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/daniel-sc/bash-shell-to-bat-converter.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/daniel-sc/bash-shell-to-bat-converter/context:javascript)

Converts bash scripts (`*.sh`) to windows batch files (`*.bat`).
This is _not_ supposed to be a fully complete/correct tool, but rather a starting point when converting scripts.
Expand Down
4 changes: 2 additions & 2 deletions src/convert-bash.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// patch for irrelevant node dependency of bash-parser:
if (typeof window === 'undefined') {
// @ts-ignore
let window = {process: {env: {NODE_NEV: 'mock'}}};
let window = {process: {env: {NODE_NEV: 'mock'}}}; // lgtm [js/unused-local-variable]
// @ts-ignore
} else if (!window.process) {
// @ts-ignore
Expand Down Expand Up @@ -71,7 +71,7 @@ class ConvertBash {
return this.cpHandler.handle(command);

default:
return `${command.name.text}${suffix}`
return `${command.name.text}${suffix}`;
}
}
return 'unknown command: ' + JSON.stringify(command);
Expand Down
2 changes: 1 addition & 1 deletion src/cp-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class CpHandler implements CommandHandler {
}

handle(command: any): string {
const {singleDashParams, doubleDashParams, argList} = splitParams(command);
const {singleDashParams, argList} = splitParams(command);
const winParams: string[] = [];
singleDashParams.forEach(suffix => {
if (suffix.text.indexOf('d') >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/rm-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class RmHandler implements CommandHandler {
}

handle(command: any): string {
const {singleDashParams, doubleDashParams, argList} = splitParams(command);
const {singleDashParams, argList} = splitParams(command);
const winParams: string[] = [];
singleDashParams.forEach(suffix => {
if (suffix.text.indexOf('r') >= 0) {
Expand Down

0 comments on commit 7e2da14

Please sign in to comment.