diff --git a/build-executables.sh b/build-executables.sh index 4d22dae..8607e75 100755 --- a/build-executables.sh +++ b/build-executables.sh @@ -10,7 +10,7 @@ platforms=( for platform in "${platforms[@]}" do - platform_split=(${platform//\// }) + platform_split=(${platform//\// }) GOOS=${platform_split[0]} GOARCH=${platform_split[1]} @@ -34,13 +34,20 @@ do fi zip_name="sysinfo-${version}-${os}-${GOARCH}" + + # Create checksum for the built file + checksum_file="${output_name}.sha256" + echo "Generating checksum for release/$output_name..." + sha256sum release/$output_name > release/$checksum_file + pushd release > /dev/null if [ $os = "windows" ]; then - zip $zip_name.zip $output_name - rm $output_name + zip $zip_name.zip $output_name $checksum_file + rm $output_name $checksum_file else chmod a+x $output_name gzip $output_name + gzip $checksum_file fi popd > /dev/null -done \ No newline at end of file +done diff --git a/cmd/full.go b/cmd/full.go index 185e75a..061f8c5 100644 --- a/cmd/full.go +++ b/cmd/full.go @@ -24,10 +24,9 @@ package cmd import ( "encoding/json" "fmt" + "github.com/dragonsecurity/sysinfo/pkg/sysinfo" "log" - "github.com/dragonsecurity/sysinfo/sysinfo" - "github.com/spf13/cobra" ) diff --git a/cmd/meta.go b/cmd/meta.go index e4ab8b7..2914983 100644 --- a/cmd/meta.go +++ b/cmd/meta.go @@ -22,8 +22,7 @@ THE SOFTWARE. package cmd import ( - "github.com/dragonsecurity/sysinfo/sysinfo" - + "github.com/dragonsecurity/sysinfo/pkg/sysinfo" "github.com/spf13/cobra" ) diff --git a/cmd/os.go b/cmd/os.go index 1337d0b..a9225a6 100644 --- a/cmd/os.go +++ b/cmd/os.go @@ -22,7 +22,7 @@ THE SOFTWARE. package cmd import ( - "github.com/dragonsecurity/sysinfo/sysinfo" + "github.com/dragonsecurity/sysinfo/pkg/sysinfo" "github.com/spf13/cobra" ) diff --git a/cmd/version.go b/cmd/version.go index efeff8a..ad37c48 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -22,8 +22,7 @@ THE SOFTWARE. package cmd import ( - "github.com/dragonsecurity/sysinfo/sysinfo" - + "github.com/dragonsecurity/sysinfo/pkg/sysinfo" "github.com/spf13/cobra" ) diff --git a/sysinfo/bios.go b/pkg/sysinfo/bios.go similarity index 100% rename from sysinfo/bios.go rename to pkg/sysinfo/bios.go diff --git a/sysinfo/board.go b/pkg/sysinfo/board.go similarity index 100% rename from sysinfo/board.go rename to pkg/sysinfo/board.go diff --git a/sysinfo/chassis.go b/pkg/sysinfo/chassis.go similarity index 100% rename from sysinfo/chassis.go rename to pkg/sysinfo/chassis.go diff --git a/sysinfo/cpu.go b/pkg/sysinfo/cpu.go similarity index 100% rename from sysinfo/cpu.go rename to pkg/sysinfo/cpu.go diff --git a/sysinfo/cpuid/cpuid.go b/pkg/sysinfo/cpuid/cpuid.go similarity index 100% rename from sysinfo/cpuid/cpuid.go rename to pkg/sysinfo/cpuid/cpuid.go diff --git a/sysinfo/cpuid/cpuid_386.s b/pkg/sysinfo/cpuid/cpuid_386.s similarity index 100% rename from sysinfo/cpuid/cpuid_386.s rename to pkg/sysinfo/cpuid/cpuid_386.s diff --git a/sysinfo/cpuid/cpuid_amd64.s b/pkg/sysinfo/cpuid/cpuid_amd64.s similarity index 100% rename from sysinfo/cpuid/cpuid_amd64.s rename to pkg/sysinfo/cpuid/cpuid_amd64.s diff --git a/sysinfo/cpuid/cpuid_default.s b/pkg/sysinfo/cpuid/cpuid_default.s similarity index 100% rename from sysinfo/cpuid/cpuid_default.s rename to pkg/sysinfo/cpuid/cpuid_default.s diff --git a/sysinfo/hypervisor.go b/pkg/sysinfo/hypervisor.go similarity index 96% rename from sysinfo/hypervisor.go rename to pkg/sysinfo/hypervisor.go index 7220d8f..ab9e8f1 100644 --- a/sysinfo/hypervisor.go +++ b/pkg/sysinfo/hypervisor.go @@ -1,7 +1,7 @@ package sysinfo import ( - "github.com/dragonsecurity/sysinfo/sysinfo/cpuid" + "github.com/dragonsecurity/sysinfo/pkg/sysinfo/cpuid" "strings" "unsafe" ) diff --git a/sysinfo/kernel_darwin.go b/pkg/sysinfo/kernel_darwin.go similarity index 100% rename from sysinfo/kernel_darwin.go rename to pkg/sysinfo/kernel_darwin.go diff --git a/sysinfo/kernel_linux.go b/pkg/sysinfo/kernel_linux.go similarity index 100% rename from sysinfo/kernel_linux.go rename to pkg/sysinfo/kernel_linux.go diff --git a/sysinfo/memory.go b/pkg/sysinfo/memory.go similarity index 100% rename from sysinfo/memory.go rename to pkg/sysinfo/memory.go diff --git a/sysinfo/meta.go b/pkg/sysinfo/meta.go similarity index 100% rename from sysinfo/meta.go rename to pkg/sysinfo/meta.go diff --git a/sysinfo/network.go b/pkg/sysinfo/network.go similarity index 100% rename from sysinfo/network.go rename to pkg/sysinfo/network.go diff --git a/sysinfo/node.go b/pkg/sysinfo/node.go similarity index 100% rename from sysinfo/node.go rename to pkg/sysinfo/node.go diff --git a/sysinfo/os.go b/pkg/sysinfo/os.go similarity index 100% rename from sysinfo/os.go rename to pkg/sysinfo/os.go diff --git a/sysinfo/product.go b/pkg/sysinfo/product.go similarity index 100% rename from sysinfo/product.go rename to pkg/sysinfo/product.go diff --git a/sysinfo/storage.go b/pkg/sysinfo/storage.go similarity index 100% rename from sysinfo/storage.go rename to pkg/sysinfo/storage.go diff --git a/sysinfo/sysinfo.go b/pkg/sysinfo/sysinfo.go similarity index 100% rename from sysinfo/sysinfo.go rename to pkg/sysinfo/sysinfo.go diff --git a/sysinfo/util.go b/pkg/sysinfo/util.go similarity index 100% rename from sysinfo/util.go rename to pkg/sysinfo/util.go diff --git a/sysinfo/version.go b/pkg/sysinfo/version.go similarity index 100% rename from sysinfo/version.go rename to pkg/sysinfo/version.go