Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
allanice001 committed Dec 14, 2024
1 parent bd6a29f commit 6758db8
Show file tree
Hide file tree
Showing 26 changed files with 16 additions and 12 deletions.
15 changes: 11 additions & 4 deletions build-executables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ platforms=(

for platform in "${platforms[@]}"
do
platform_split=(${platform//\// })
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}

Expand All @@ -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
done
3 changes: 1 addition & 2 deletions cmd/full.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ THE SOFTWARE.
package cmd

import (
"github.com/dragonsecurity/sysinfo/sysinfo"

"github.com/dragonsecurity/sysinfo/pkg/sysinfo"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.
package cmd

import (
"github.com/dragonsecurity/sysinfo/sysinfo"
"github.com/dragonsecurity/sysinfo/pkg/sysinfo"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ THE SOFTWARE.
package cmd

import (
"github.com/dragonsecurity/sysinfo/sysinfo"

"github.com/dragonsecurity/sysinfo/pkg/sysinfo"
"github.com/spf13/cobra"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion sysinfo/hypervisor.go → pkg/sysinfo/hypervisor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sysinfo

import (
"github.com/dragonsecurity/sysinfo/sysinfo/cpuid"
"github.com/dragonsecurity/sysinfo/pkg/sysinfo/cpuid"
"strings"
"unsafe"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6758db8

Please sign in to comment.