Skip to content

Commit

Permalink
fix: bad distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalSin9h committed Nov 21, 2024
1 parent af4a04a commit f030f33
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.28)
cmake_minimum_required(VERSION 3.22)
project(RunScript)

if(UNIX AND NOT APPLE)
Expand Down Expand Up @@ -27,15 +27,15 @@ if(UNIX AND NOT APPLE)
message(STATUS "Detected Debian Linux")
set(DISTRO "Debian Linux")
add_custom_target(run_script
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev patchelf libappindicator3-dev librsvg2-dev -y
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev -y
COMMENT "Running script on Debian Linux"
)

else()
message(STATUS "Detected ${LINUX_ID}-like Linux distribution")
set(DISTRO "${LINUX_ID}-like Linux")
add_custom_target(run_script
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev patchelf libappindicator3-dev librsvg2-dev -y
COMMAND sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev -y
COMMENT "Running script on Debian Linux"
)

Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.30
# Generated by "Unix Makefiles" Generator, CMake Version 3.22

# Default target executed when no arguments are given to make.
default_target: all
Expand Down Expand Up @@ -48,27 +48,27 @@ cmake_force:
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /snap/cmake/1413/bin/cmake
CMAKE_COMMAND = /usr/bin/cmake

# The command to remove a file.
RM = /snap/cmake/1413/bin/cmake -E rm -f
RM = /usr/bin/cmake -E rm -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /media/kunalsin9h/hdd_drive/github/secops
CMAKE_SOURCE_DIR = /media/kunal/hdd_drive/github/secops

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /media/kunalsin9h/hdd_drive/github/secops
CMAKE_BINARY_DIR = /media/kunal/hdd_drive/github/secops

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
/snap/cmake/1413/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache

# Special rule for the target edit_cache
Expand All @@ -77,8 +77,8 @@ edit_cache/fast: edit_cache

# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
/snap/cmake/1413/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
Expand All @@ -87,9 +87,9 @@ rebuild_cache/fast: rebuild_cache

# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /media/kunalsin9h/hdd_drive/github/secops/CMakeFiles /media/kunalsin9h/hdd_drive/github/secops//CMakeFiles/progress.marks
$(CMAKE_COMMAND) -E cmake_progress_start /media/kunal/hdd_drive/github/secops/CMakeFiles /media/kunal/hdd_drive/github/secops//CMakeFiles/progress.marks
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /media/kunalsin9h/hdd_drive/github/secops/CMakeFiles 0
$(CMAKE_COMMAND) -E cmake_progress_start /media/kunal/hdd_drive/github/secops/CMakeFiles 0
.PHONY : all

# The main clean target
Expand Down
Binary file removed public/arch.png
Binary file not shown.
2 changes: 1 addition & 1 deletion src-tauri/src/commands/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub async fn get_distro() -> Result<String, rspc::Error> {
"cat",
false,
true,
vec!["/etc/*-release"],
vec!["/etc/lsb-release"],
)
.exec(None)
{
Expand Down
9 changes: 3 additions & 6 deletions src/components/Home/DistroBranding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ export default function LinuxDistribution() {
}

const info = data.split("\n");
const release = info[2].replace(
/PRETTY_NAME=("|')(.*?)\1|DISTRIB_CODENAME=("|')(.*?)\3/g,
"$2$4",
);
const release = info[2].replace('DISTRIB_CODENAME=', "");

const distro_name = info[3]
.replace('DISTRIB_DESCRIPTION="', "")
.replace('"', "")
.replace("ID=", "");
.replace('"', "");

distroContext?.setDistro(distro_name);

Expand Down
5 changes: 1 addition & 4 deletions src/components/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@ import DistroBranding from "./DistroBranding.tsx";
export default function Home() {
const distroContext = useContext(DistroContext);

const imageSrc =
distroContext?.distro === "arch" ? "/arch.png" : "/ubuntu.png";

return (
<div className="flex gap-2 xl:gap-4 h-[84vh]">
<div className="w-1/3 flex flex-col gap-2 xl:gap-4">
<div className="h-24 xl:h-36 border rounded shadow p-1 xl:p-2 flex items-center justify-center">
<div className="flex gap-2 xl:gap-4 items-center">
<img
src={imageSrc}
src={"/ubuntu.png"}
alt={distroContext?.distro + "Desktop Logo"}
className="h-14 xl:h-24 w-14 xl:w-24"
/>
Expand Down

0 comments on commit f030f33

Please sign in to comment.