-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:tessel/t2-cli into jon-wifi-off
# By Rick Waldron (9) and others # Via Rick Waldron (7) and others * 'master' of github.com:tessel/t2-cli: (21 commits) Add appveyor badge to readme Instead of rethrowing errors, log them. Fixes gh-449 Fix jscs error: dont use future reserved words as identifiers Updating grunt-jscs fix(access-point): removes template literals cause jsbeautify Tweak status messages replaces new Errors with strings fix(access-point): creates boilerplate for new access point when required Adds check step to AP setup. Needs AP _new_ iface. fix(ap/wifi): working implementation refactor(access-point): simpler, cleaner tests and source code tests(access-point): initial implementation feat(access-point): adds ability to enable/disable AP fix: working access point configuration fix(ap): now able to configure ap setup feat(ap): initial access point creation implementation When single flag is present, do not traverse upward for package.json. Fixes gh-442 Ensure that bundling errors make are surfaced. Fixes gh-441 Adding linux driver install only set key if requested ... Conflicts: lib/controller.js
- Loading branch information
Showing
27 changed files
with
1,143 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env node | ||
|
||
var fs = require('fs'); | ||
var logs = require('../lib/logs'); | ||
var child_process = require('child_process'); | ||
|
||
module.exports.install = function() { | ||
if (process.platform === 'linux') { | ||
var rules_name = '85-tessel.rules'; | ||
var dest = '/etc/udev/rules.d/' + rules_name; | ||
var rules = fs.readFileSync(__dirname + '/../resources/' + rules_name); | ||
|
||
try { | ||
fs.writeFileSync(dest, rules); | ||
} catch (e) { | ||
if (e.code === 'EACCES') { | ||
logs.info('Could not write to ' + dest); | ||
logs.info('Run `sudo t2 install-drivers`'); | ||
return -1; | ||
} else { | ||
throw e; | ||
} | ||
} | ||
logs.info('udev rules installed to ' + dest); | ||
|
||
|
||
var udevadm = child_process.spawn('udevadm', ['control', '--reload-rules']); | ||
udevadm.on('close', function(code) { | ||
if (code !== 0) { | ||
logs.error('Error reloading udev'); | ||
return code; | ||
} else { | ||
logs.info('Done. Unplug and re-plug Tessel to update permissions.'); | ||
return code; | ||
} | ||
}); | ||
} else { | ||
logs.info('No driver installation necessary.'); | ||
} | ||
|
||
}; |
Oops, something went wrong.