Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
augustctl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
augustctl
Commits
4de3d24f
Commit
4de3d24f
authored
10 years ago
by
Dan Walters
Browse files
Options
Downloads
Patches
Plain Diff
Simplify, just load configuration from a config.json.
parent
81a5facb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
cli.js
+3
-2
3 additions, 2 deletions
cli.js
config.js
+0
-17
0 additions, 17 deletions
config.js
tools/decode_capture.js
+1
-1
1 addition, 1 deletion
tools/decode_capture.js
with
6 additions
and
20 deletions
.gitignore
+
2
−
0
View file @
4de3d24f
.DS_Store
node_modules
config.json
This diff is collapsed.
Click to expand it.
cli.js
+
3
−
2
View file @
4de3d24f
#!/usr/bin/env node
'
use strict
'
;
var
Lock
=
require
(
'
./lib/lock
'
);
var
noble
=
require
(
'
noble
'
);
...
...
@@ -7,7 +9,6 @@ var argv = require('yargs')
.
usage
(
'
Control an August Smart Lock.
\n
Usage: $0 [command]
'
)
.
example
(
'
$0 lock
'
,
'
closes the lock
'
)
.
example
(
'
$0 unlock
'
,
'
opens the lock
'
)
.
describe
(
'
config
'
,
'
configuration file (default is $HOME/.config/augustctl.json)
'
)
.
check
(
function
(
argv
)
{
if
(
argv
.
_
.
length
!==
1
)
{
return
'
must specify an operation to perform
'
;
...
...
@@ -20,7 +21,7 @@ var argv = require('yargs')
})
.
argv
;
var
config
=
require
(
'
./config
'
)(
argv
.
config
);
var
config
=
require
(
process
.
env
.
AUGUSTCTL_CONFIG
||
'
./config.json
'
);
noble
.
on
(
'
stateChange
'
,
function
(
state
)
{
if
(
state
===
'
poweredOn
'
)
{
...
...
This diff is collapsed.
Click to expand it.
config.js
deleted
100644 → 0
+
0
−
17
View file @
81a5facb
var
fs
=
require
(
'
fs
'
);
function
loadConfig
(
filename
)
{
if
(
!
filename
)
{
var
configDir
=
process
.
env
.
XDG_CONFIG_HOME
||
(
process
.
env
.
HOME
+
'
/.config
'
);
filename
=
configDir
+
'
/augustctl.json
'
;
}
var
config
=
JSON
.
parse
(
fs
.
readFileSync
(
filename
));
if
(
!
config
.
offlineKey
||
!
config
.
offlineKeyOffset
)
{
throw
new
Error
(
"
config file must specify offlineKey and offlineKeyOffset
"
);
}
return
config
;
}
module
.
exports
=
loadConfig
;
This diff is collapsed.
Click to expand it.
tools/decode_capture.js
+
1
−
1
View file @
4de3d24f
...
...
@@ -73,5 +73,5 @@ function decodeLog(offlineKey, filename) {
});
}
var
config
=
require
(
'
../config
'
)(
);
var
config
=
require
(
process
.
env
.
AUGUSTCTL_CONFIG
||
'
../config
.json
'
);
decodeLog
(
config
.
offlineKey
,
process
.
argv
[
2
]);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment