Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipto Pandit (dipandit) committed Jan 28, 2021
1 parent bb81fb5 commit 18529b6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The dependency directory structure should be like below:
```
You should now see the below items in status bar:

![status bar items](img/status-items.png)
![status bar items](https://raw.githubusercontent.com/diptopandit/vscode-snort3-build-tools/main/img/status-items.png)

Clicking on the icons will trigger the below commands respectively. The icons will animate when the task is in progress.

Expand All @@ -49,6 +49,6 @@ This extension provides two commands:
* build: configure snort3
* build: build snort3

![registered commands](img/commands.png)
![registered commands](https://raw.githubusercontent.com/diptopandit/vscode-snort3-build-tools/main/img/commands.png)

Contributions are welcome
Binary file modified img/snort_configure_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
"icon": "img/snort_configure_logo.png",
"author": "Dipto Pandit <dipandit@cisco.com>",
"publisher": "diptopandit",
"version": "0.0.1",
"version": "1.0.0",
"license": "MIT",
"homepage": "https://github.com/diptopandit/vscode-snort3-test-adapter",
"homepage": "https://github.com/diptopandit/vscode-snort3-build-tools",
"repository": {
"type": "git",
"url": "https://github.com/diptopandit/vscode-snort3-test-adapter.git"
"url": "https://github.com/diptopandit/vscode-snort3-build-tools.git"
},
"bugs": {
"url": "https://github.com/diptopandit/vscode-snort3-test-adapter/issues"
"url": "https://github.com/diptopandit/vscode-snort3-build-tools/issues"
},
"categories": [
"Other"
Expand All @@ -24,7 +24,6 @@
"snort3"
],
"main": "out/main.js",
"enableProposedApi": true,
"scripts": {
"clean": "rimraf out *.vsix",
"build": "tsc",
Expand Down Expand Up @@ -91,7 +90,7 @@
},
"snort3BuildTools.snort_build_dir": {
"description": "absolute path to snort build working directory",
"type":"string",
"type": "string",
"scope": "resource"
}
}
Expand Down
Binary file removed release/snort3-build-tools-0.0.1.vsix
Binary file not shown.
Binary file added release/snort3-build-tools-1.0.0.vsix
Binary file not shown.
23 changes: 16 additions & 7 deletions src/build_tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export const snort3BuildTools = {
open: async () => {
writeEmitter.fire('*** Configuring snort3 ***\r\n');
cp = child_process.spawn('./configure_cmake.sh',config_args, {cwd:workspace.uri.path, env:config.env});
if(!cp || !cp.pid) writeEmitter.fire('**** ERROR starting configure task ****\r\n');
if(!cp || !cp.pid) {
writeEmitter.fire('**** ERROR starting configure task ****\r\n');
myStatusBarItems[1].text=`$(tools)`;
this.busy = false;
}
cp!.stdout!.setEncoding('utf8');
cp!.stderr!.setEncoding('utf8');
cp!.stderr!.on('data',(data)=>{
Expand All @@ -84,7 +88,7 @@ export const snort3BuildTools = {
this.busy = false;
},
handleInput:()=>{
terminal.dispose();
if(!this.busy && terminal) terminal.dispose();
}
};

Expand All @@ -100,7 +104,7 @@ export const snort3BuildTools = {
return;
}
this.busy = true;
myStatusBarItems[2].text=`$(gear~spin)`
myStatusBarItems[2].text=`$(settings-gear~spin)`
const writeEmitter = new vscode.EventEmitter<string>();
var cp:child_process.ChildProcess|undefined = undefined;
let config = get_config();
Expand All @@ -117,7 +121,12 @@ export const snort3BuildTools = {
writeEmitter.fire('*** Building snort3 ***\r\n');
writeEmitter.fire('make '+concurrency+' install\r\n')
cp = child_process.spawn('make',config_args, {cwd:build_dir, env:config.env});
if(!cp || !cp.pid) writeEmitter.fire('**** ERROR starting build task ****\r\n');
if(!cp || !cp.pid){
writeEmitter.fire('**** ERROR starting build task ****\r\n');
myStatusBarItems[2].text=`$(settings-gear)`;
this.busy = false;
return;
}
cp!.stdout!.setEncoding('utf8');
cp!.stderr!.setEncoding('utf8');
cp!.stderr!.on('data',(data)=>{
Expand All @@ -129,7 +138,7 @@ export const snort3BuildTools = {
cp!.once('exit',()=>{
writeEmitter.fire('**** Build task complete ****\n\rPress eny key to close this terminal\r\n');
cp = undefined;
myStatusBarItems[2].text=`$(gear)`;
myStatusBarItems[2].text=`$(settings-gear)`;
this.busy = false;
});
},
Expand All @@ -138,11 +147,11 @@ export const snort3BuildTools = {
cp.kill("SIGKILL");
cp = undefined;
}
myStatusBarItems[2].text=`$(gear)`
myStatusBarItems[2].text=`$(settings-gear)`;
this.busy = false;
},
handleInput:()=>{
if(!this.busy) terminal.dispose();
if(!this.busy && terminal) terminal.dispose();
}
};
terminal = (<any>vscode.window).createTerminal({name:`Make : Snort3 Build Tools`, pty:pty});
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function activate(context: vscode.ExtensionContext) {
myStatusBarItems[1].text=`$(tools)`;
myStatusBarItems[1].tooltip='Configure snort3';
myStatusBarItems[1].command='snort3BuildTools.configure';
myStatusBarItems[2].text = '$(gear)';
myStatusBarItems[2].text = '$(settings-gear)';
myStatusBarItems[2].tooltip='Build snort3';
myStatusBarItems[2].command='snort3BuildTools.build'
myStatusBarItems[3].text=`]`;
Expand Down

0 comments on commit 18529b6

Please sign in to comment.