Skip to content

Commit

Permalink
replace "npx" with binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-haskell committed Feb 24, 2023
1 parent dddcaac commit d1e2fbd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Binary file renamed elm-land-0.1.3.vsix → elm-land-0.1.4.vsix
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "elm-land",
"displayName": "Elm Land",
"description": "A minimal plugin for Elm",
"version": "0.1.3",
"version": "0.1.4",
"icon": "src/elm-land-plugin.png",
"publisher": "elm-land",
"repository": "https://github.com/elm-land/elm-land",
Expand Down
4 changes: 3 additions & 1 deletion src/features/elm-format-on-save.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'path'
import * as vscode from 'vscode'
import * as child_process from "child_process"
import { Feature } from './shared/logic'
Expand Down Expand Up @@ -25,7 +26,8 @@ const provideDocumentFormattingEdits = async (
}

function runElmFormat(document: vscode.TextDocument): Promise<string> {
const command = `npx elm-format --stdin --yes`
const elmFormat = path.join(__dirname, '..', '..', 'node_modules', '.bin', 'elm-format')
const command = `${elmFormat} --stdin --yes`
const original = document.getText()
return new Promise((resolve, reject) => {
const process_ = child_process.exec(command, (err, stdout, stderr) => {
Expand Down
3 changes: 2 additions & 1 deletion src/features/error-highlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ type ParsedReportError = {
const Elm = {
compile: (input: { elmJsonFile: ElmJsonFile, elmFilesToCompile: string[] }): Promise<ParsedError | undefined> => {
let deduplicated = [...new Set(input.elmFilesToCompile)]
const command = `(cd ${input.elmJsonFile.projectFolder} && npx elm make ${deduplicated.join(' ')} --output=/dev/null --report=json)`
const elm = path.join(__dirname, '..', '..', 'node_modules', '.bin', 'elm')
const command = `(cd ${input.elmJsonFile.projectFolder} && ${elm} make ${deduplicated.join(' ')} --output=/dev/null --report=json)`
const promise: Promise<ParsedError | undefined> =
new Promise((resolve) =>
child_process.exec(command, (err, _, stderr) => {
Expand Down

0 comments on commit d1e2fbd

Please sign in to comment.