From cef2a4e9be4f3a5de56175edafc9c19cd6958cb8 Mon Sep 17 00:00:00 2001 From: Patrick Pacher Date: Fri, 17 Jul 2020 12:13:13 +0200 Subject: [PATCH] Move portmaster binary to cmds/portmaster-core --- cmds/portmaster-core/.gitignore | 7 +++++++ build => cmds/portmaster-core/build | 0 main.go => cmds/portmaster-core/main.go | 0 pack_core => cmds/portmaster-core/pack | 2 +- cmds/portmaster-start/pack | 2 +- cmds/portmaster-start/update.go | 2 +- pack | 22 +++++++++++----------- 7 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 cmds/portmaster-core/.gitignore rename build => cmds/portmaster-core/build (100%) rename main.go => cmds/portmaster-core/main.go (100%) rename pack_core => cmds/portmaster-core/pack (98%) diff --git a/cmds/portmaster-core/.gitignore b/cmds/portmaster-core/.gitignore new file mode 100644 index 00000000..eff36331 --- /dev/null +++ b/cmds/portmaster-core/.gitignore @@ -0,0 +1,7 @@ +# Compiled binaries +portmaster +portmaster.exe +dnsonly +dnsonly.exe +main +main.exe diff --git a/build b/cmds/portmaster-core/build similarity index 100% rename from build rename to cmds/portmaster-core/build diff --git a/main.go b/cmds/portmaster-core/main.go similarity index 100% rename from main.go rename to cmds/portmaster-core/main.go diff --git a/pack_core b/cmds/portmaster-core/pack similarity index 98% rename from pack_core rename to cmds/portmaster-core/pack index de86b2f8..0b2a925b 100755 --- a/pack_core +++ b/cmds/portmaster-core/pack @@ -7,7 +7,7 @@ COL_OFF="\033[00m" COL_BOLD="\033[01;01m" COL_RED="\033[31m" -destDirPart1="dist" +destDirPart1="../../dist" destDirPart2="core" function check { diff --git a/cmds/portmaster-start/pack b/cmds/portmaster-start/pack index 79fdf784..cf213517 100755 --- a/cmds/portmaster-start/pack +++ b/cmds/portmaster-start/pack @@ -7,7 +7,7 @@ COL_OFF="\033[00m" COL_BOLD="\033[01;01m" COL_RED="\033[31m" -destDirPart1="../dist" +destDirPart1="../../dist" destDirPart2="start" function check { diff --git a/cmds/portmaster-start/update.go b/cmds/portmaster-start/update.go index edb4c8f1..af018e66 100644 --- a/cmds/portmaster-start/update.go +++ b/cmds/portmaster-start/update.go @@ -46,7 +46,7 @@ func downloadUpdates() error { "all/ui/modules/base.zip", ) - // logging is configured as a presistent pre-run method inherited from + // logging is configured as a persistent pre-run method inherited from // the root command but since we don't use run.Run() we need to start // logging ourself. err := log.Start() diff --git a/pack b/pack index 0b74c350..144f303b 100755 --- a/pack +++ b/pack @@ -5,12 +5,19 @@ cd "$baseDir" # first check what will be built +function packAll() { + for i in ./cmds/* ; do + if [ -e $i/pack ]; then + $i/pack $1 + fi + done +} + echo "" echo "pack list:" echo "" -./pmctl/pack check -./pack_core check +packAll check # confirm @@ -20,15 +27,8 @@ echo "" # build -./pmctl/pack build -if [[ $? -ne 0 ]]; then - exit 1 -fi - -./pack_core build -if [[ $? -ne 0 ]]; then - exit 1 -fi +set -e +packAll build echo "" echo "finished packing."