Skip to content

Commit

Permalink
Merge pull request #30 from SquitchYT/dev-windows-support
Browse files Browse the repository at this point in the history
Dev windows support
  • Loading branch information
SquitchYT authored Jun 22, 2023
2 parents 711f53a + 6f6c4d3 commit a5d4551
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 245 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,41 @@ jobs:
with:
files: |
src-tauri/target/${{ matrix.target }}/release/tess-${{ matrix.target }}
generate-windows-binaries:
name: Build Windows binary for target ${{ matrix.target }}
strategy:
matrix:
target:
- x86_64-pc-windows-msvc

runs-on: windows-2019
steps:
- uses: actions/checkout@v3

- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 'latest'

- name: Install Rustup
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Build frontend
run: |
npm i
npm run build
- name: Build binary
run: |
cd src-tauri
cargo build --release --target ${{ matrix.target }}
mv target/${{ matrix.target }}/release/tess.exe target/${{ matrix.target }}/release/tess-${{ matrix.target }}.exe
- name: Publish binary
uses: softprops/action-gh-release@v1
with:
files: |
src-tauri/target/${{ matrix.target }}/release/tess-${{ matrix.target }}.exe
71 changes: 51 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "cp node_modules/xterm/css/xterm.css src/style/xterm.css; vite",
"dev": "vite",
"build": "tsc && vite build --emptyOutDir",
"preview": "vite preview"
},
"devDependencies": {
"@types/node": "^18.11.9",
"@types/uuid": "^9.0.0",
"postcss": "^8.4.24",
"postcss-discard-comments": "^6.0.0",
"sass": "^1.56.1",
"typescript": "^4.6.4",
"vite": "^3.2.3"
Expand Down
7 changes: 7 additions & 0 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = () => {
return {
plugins: [
require("postcss-discard-comments"),
],
};
};
31 changes: 24 additions & 7 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tess"
version = "0.7.0-alpha.1"
version = "0.7.0-alpha.4"
description = "Fast. Lightweight. Famous. Terminal for the new era."
authors = ["Squitch"]
repository = "https://github.com/SquitchYT/Tess"
Expand All @@ -24,6 +24,10 @@ tokio = "1.25.0"
dirs-next = "2.0.0"
uuid = "1.3.0"

[target.'cfg(windows)'.dependencies]
lazy_static = "1.4.0"
regex = "1.8.4"

[features]
default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]
Expand Down
24 changes: 22 additions & 2 deletions src-tauri/src/configuration/deserialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@ impl<'de> serde::Deserialize<'de> for Option {

if partial_option.profiles.is_empty() {
profiles.push(
Profile { name: String::from("Default profile"), terminal_options: partial_option.terminal.clone(), theme: terminal_theme.clone(), background_transparency: RangedInt::default(), uuid: uuid::Uuid::new_v4().to_string(), command: String::from("sh -c $SHELL") /* TODO: Set correct for each oses*/ }
Profile {
name: String::from("Default profile"),
terminal_options: partial_option.terminal.clone(),
theme: terminal_theme.clone(),
background_transparency: RangedInt::default(),
uuid: uuid::Uuid::new_v4().to_string(),
#[cfg(target_family = "unix")]
command: String::from("sh -c $SHELL"),
#[cfg(target_os = "windows")]
command: String::from("%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"),
}
)
} else {
for partial_profile in partial_option.profiles {
Expand Down Expand Up @@ -474,7 +484,17 @@ fn default_to_true() -> bool {
}

fn default_profile(uuid: String) -> Profile {
Profile { name: String::from("Default profile"), terminal_options: TerminalOption::default(), theme: TerminalTheme::default(), background_transparency: RangedInt::default(), uuid, command: String::from("sh -c $SHELL") /* TODO: Set correct for each oses*/ }
Profile {
name: String::from("Default profile"),
terminal_options: TerminalOption::default(),
theme: TerminalTheme::default(),
background_transparency: RangedInt::default(),
uuid,
#[cfg(target_family = "unix")]
command: String::from("sh -c $SHELL"),
#[cfg(target_os = "windows")]
command: String::from("%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"),
}
}

fn default_shortcuts() -> Vec<Shortcut> {
Expand Down
6 changes: 6 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ fn main() {
let start = std::time::Instant::now();
let logger = Arc::from(Logger {});

#[cfg(target_family = "unix")]
let config_file = std::fs::read_to_string(format!(
"{}/tess/config.json",
dirs_next::config_dir().unwrap_or_default().display()
));
#[cfg(target_os = "windows")]
let config_file = std::fs::read_to_string(format!(
"{}/Tess/config.json",
dirs_next::config_dir().unwrap_or_default().display()
));


let option = Arc::from(Mutex::from(if let Ok(config_file) = config_file {
Expand Down
Loading

0 comments on commit a5d4551

Please sign in to comment.