fix codestyle, add editorconfig, align with vala-lint

This commit is contained in:
Nikolay Brovko 2020-01-24 15:37:04 +03:00
parent 5407e06683
commit 7e7c0a3ce5
No known key found for this signature in database
GPG Key ID: 32258A3DEC9B6F07
3 changed files with 113 additions and 99 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.vala]
indent_style = space
indent_size = 4
charset = utf-8

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/build /build
/yggtk /yggtk
*\#*

View File

@ -47,17 +47,17 @@ int main (string[] args) {
status.notify["active"].connect (() => { status.notify["active"].connect (() => {
if (status.get_active()) { if (status.get_active ()) {
start(); start ();
} else { } else {
stop(); stop ();
} }
check_status(status); check_status (status);
}); });
@ -65,7 +65,7 @@ int main (string[] args) {
yggtk.clicked.connect (() => { yggtk.clicked.connect (() => {
update(); update ();
}); });
@ -93,7 +93,9 @@ int download () {
if (pm == "Cannot run program pacman: No such file or directory\n") { if (pm == "Cannot run program pacman: No such file or directory\n") {
Process.spawn_command_line_sync ("wget https://2375-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.12-amd64.deb"); Process.spawn_command_line_sync (
"wget https://2375-115685026-gh.circle-artifacts.com/0/yggdrasil-0.3.12-amd64.deb"
);
Process.spawn_command_line_sync ("pkexec dpkg -i yggdrasil-0.3.12-amd64.deb"); Process.spawn_command_line_sync ("pkexec dpkg -i yggdrasil-0.3.12-amd64.deb");
} }
@ -111,9 +113,11 @@ int download () {
} }
string mktempdir () throws Error { string mktempdir () throws Error {
string temp_dir = null; string temp_dir = null;
Process.spawn_command_line_sync("mktemp -d", out temp_dir); Process.spawn_command_line_sync ("mktemp -d", out temp_dir);
return temp_dir.strip (); return temp_dir.strip ();
} }
int update () { int update () {
@ -122,7 +126,6 @@ int update () {
unowned string repo_url = Environment.get_variable ("YGG_UPDATE_REPO"); unowned string repo_url = Environment.get_variable ("YGG_UPDATE_REPO");
string temp_dir = mktempdir (); string temp_dir = mktempdir ();
string command = null;
if (repo_url == null) { if (repo_url == null) {
repo_url = "https://git.macaw.me/plant_1312/Yggtk.git"; repo_url = "https://git.macaw.me/plant_1312/Yggtk.git";