Skip to content

Commit

Permalink
all: imp code, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Jun 3, 2021
1 parent 512ee6d commit 3ff109e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to

### Added

- Experimental OpenBSD support for AMD64 and ARM64 ([#2439]).
- Experimental OpenBSD support for AMD64 and 64-bit ARM CPUs ([#2439]).
- Support for custom port in DNS-over-HTTPS profiles for Apple's devices
([#3172]).
- `darwin/arm64` support ([#2443]).
Expand Down
7 changes: 7 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ on GitHub and most other Markdown renderers. -->

* `snake_case`, not `camelCase` for variables. `kebab-case` for filenames.

* Start scripts with the following sections in the following order:

1. Shebang.
1. Some initial documentation (optional).
1. Verbosity level parsing (optional).
1. `set` options.

* UPPERCASE names for external exported variables, lowercase for local,
unexported ones.

Expand Down
3 changes: 3 additions & 0 deletions internal/aghos/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (

// ErrUnsupported is returned when the functionality is unsupported on the
// current operating system.
//
// TODO(a.garipov): Make a structured error and use it everywhere instead of
// a bunch of fmt.Errorf and all that.
const ErrUnsupported errors.Error = "unsupported"

// CanBindPrivilegedPorts checks if current process can bind to privileged
Expand Down
7 changes: 2 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ check_required() {
(*)
# Generally shouldn't happen, since the OS has already been
# validated.
error_exit "unsupported operating system: $os"
error_exit "unsupported operating system: '$os'"
;;
esac

Expand Down Expand Up @@ -332,9 +332,6 @@ set_sudo_cmd() {
error_exit "unsupported operating system: '$os'"
;;
esac

# Log.
log "operating system: $os"
}

# Function configure sets the script's configuration.
Expand Down Expand Up @@ -363,7 +360,7 @@ is_root() {
return 0
fi

if is_command sudo || is_command doas
if is_command "$sudo_cmd"
then
log 'note that AdGuard Home requires root privileges to install using this script'

Expand Down

0 comments on commit 3ff109e

Please sign in to comment.