Skip to content

Commit

Permalink
vscodeにパスが通っていなくても大丈夫なように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
komiyamma committed Jan 20, 2021
1 parent b17bfc0 commit 9488863
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.2.5

Visual Studio Code にパスが通っていなくても動作するように修正

## 0.2.4

デバッグ目的のダイアログが表示されていたため、非表示に
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# rg-sjis

[![rg_sjis v0.2.4](https://img.shields.io/badge/rg_sjis-v0.2.4-6479ff.svg)](https://github.com/komiyamma/vscode_ripgrep_sjis_extension/releases)
[![rg_sjis v0.2.5](https://img.shields.io/badge/rg_sjis-v0.2.5-6479ff.svg)](https://github.com/komiyamma/vscode_ripgrep_sjis_extension/releases)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
![Windows Only](https://img.shields.io/badge/Windows-Only-6479ff.svg)
![.NET Framework 4.5.2](https://img.shields.io/badge/.NET_Framework-v4.5.2-6479ff.svg)


This is the grep to hit not only UTF8 but also Japanese SJIS(cp932).
When grep is done with Visual Studio Code, sjis cannot be detected if the files are a mixture of utf8 and sjis.
Expand Down Expand Up @@ -40,6 +43,9 @@ Problems occur when launching multiple Visual Studio Codes.
## Related repositories
「rg_sjis.exe という実行ファイル」がありますが、この実行ファイルのソースリポジトリは「[vscode_ripgrep_sjis](https://github.com/komiyamma/vscode_ripgrep_sjis) 」となります。

### 0.2.5

Visual Studio Code にパスが通っていなくても動作するように修正

### 0.2.4

Expand Down
2 changes: 1 addition & 1 deletion dist/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/rg_sjis.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "rg-sjis",
"displayName": "rg-sjis",
"description": "Ripgrep with Shift-JIS",
"version": "0.2.4",
"version": "0.2.5",
"engines": {
"vscode": "^1.52.0"
},
Expand Down
6 changes: 4 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import * as vscode from 'vscode';
var exec = require('child_process').exec;
const path = require('path');
var process = require('process');

export function activate(context: vscode.ExtensionContext) {
var command = path.dirname(__filename) + "/rg_sjis.exe";
vscode.window.showInformationMessage(process.execPath);
var command = path.dirname(__filename) + "/rg_sjis.exe --mode-install"+ " " + "\"" +process.execPath + "\"";
exec(command, function(error:any, stdout:any, stderr:any) {
// シェル上でコマンドを実行できなかった場合のエラー処理
if (error !== null) {
Expand All @@ -16,7 +18,7 @@ export function activate(context: vscode.ExtensionContext) {
}

export function deactivate() {
var command = path.dirname(__filename) + "/rg_sjis.exe --mode-uninstall";
var command = path.dirname(__filename) + "/rg_sjis.exe --mode-uninstall"+ " " + "\"" +process.execPath + "\"";
exec(command, function(error:any, stdout:any, stderr:any) {
// シェル上でコマンドを実行できなかった場合のエラー処理
if (error !== null) {
Expand Down

0 comments on commit 9488863

Please sign in to comment.