Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/linux-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function connectToWifi(config, ap, callback) {

// commandStr = escapeShell(commandStr);

exec(commandStr, env, function (err, resp) {
exec(commandStr, { env }, function (err, resp) {
// Errors from nmcli came from stdout, we test presence of 'Error: ' string
if (resp.includes('Error: ')) {
err = new Error(resp.replace('Error: ', ''));
Expand Down
2 changes: 1 addition & 1 deletion src/linux-current-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getCurrentConnection(config, callback) {
commandStr += ' list ifname '+config.iface;
}

exec(commandStr, env, function(err, scanResults) {
exec(commandStr, {env}, function(err, scanResults) {
if (err) {
callback && callback(err);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/linux-disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function disconnect (config, callback) {
if (config.iface) {
commandStr += " " + config.iface;
}
exec(commandStr, env, function(err, resp) {

exec(commandStr, {env}, function(err, resp) {
callback && callback(err);
});

Expand Down
2 changes: 1 addition & 1 deletion src/linux-scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function scanWifi(config, callback) {
commandStr += ' ifname '+config.iface;
}

exec(commandStr, env, function(err, scanResults) {
exec(commandStr, {env}, function(err, scanResults) {
if (err) {
callback && callback(err);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/mac-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function connectToWifi(config, ap, callback) {
commandStr = commandStr + "'" + iface + "'" + " " + "'" + ap.ssid + "'" + " " + "'" + ap.password + "'";
//console.log(commandStr);

exec(commandStr, env, function(err, resp, stderr) {
exec(commandStr, {env}, function(err, resp, stderr) {
//console.log(stderr, resp);
if (resp && resp.indexOf('Failed to join network') >= 0) {
callback && callback(resp);
Expand Down
2 changes: 1 addition & 1 deletion src/mac-current-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function parseAirport (stdout) {
function getCurrentConnections(config, callback) {
var commandStr = macProvider+" --getinfo" ;

exec(commandStr, env, function(err, stdout) {
exec(commandStr, {env}, function(err, stdout) {
if (err) {
callback && callback(err);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/mac-scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function scanWifi(config, callback) {
var networks = []
var network = {}

exec(macProvider + ' -s', env, function(err, scanResults) {
exec(macProvider + ' -s', {env}, function(err, scanResults) {

if (err) {
callback && callback(err);
Expand Down
4 changes: 2 additions & 2 deletions src/windows-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var scan = require('./windows-scan');

function execCommand(cmd) {
return new Promise(function(resolve, reject) {
exec(cmd, env, function(err, stdout, stderr) {
exec(cmd, {env}, function(err, stdout, stderr) {
if (err) {
// Add command output to error, so it's easier to handle
err.stdout = stdout;
Expand Down Expand Up @@ -49,7 +49,7 @@ function connectToWifi(config, ap, callback) {
callback && callback();
})
.catch(function(err) {
exec('netsh wlan delete profile "' + ap.ssid + '"', env, function() {
exec('netsh wlan delete profile "' + ap.ssid + '"', {env}, function() {
callback && callback(err);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/windows-current-connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function parseShowInterfaces (stdout, config) {

function getCurrentConnection(config, callback) {
var commandStr = "netsh wlan show interfaces" ;
exec(commandStr, env, function(err, stdout) {
exec(commandStr, {env}, function(err, stdout) {
if (err) {
callback && callback(err);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/windows-disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function disconnect (config, callback) {
if (config.iface) {
cmd += ' interface="' + config.iface + '"'
}
exec(cmd, env, function(err, resp) {
exec(cmd, {env}, function(err, resp) {
callback && callback(err);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/windows-scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var env = require('./env');

function scanWifi(config, callback) {
try {
exec("chcp 65001 && netsh wlan show networks mode=Bssid", env, function(err, scanResults) {
exec("chcp 65001 && netsh wlan show networks mode=Bssid", {env}, function(err, scanResults) {
if (err) {
callback && callback(err);
return;
Expand Down