mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 19:45:23 +00:00
fix: working on the windows cable channels
This commit is contained in:
parent
ae1dd99118
commit
ba1c3fe8ee
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -17,8 +17,10 @@ jobs:
|
|||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@nightly
|
uses: dtolnay/rust-toolchain@nightly
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Install fd
|
||||||
|
run: sudo apt-get install -y fd-find
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --locked --all-features --workspace
|
run: cargo test --locked --all-features --workspace -- --nocapture
|
||||||
|
|
||||||
rustfmt:
|
rustfmt:
|
||||||
name: Rustfmt
|
name: Rustfmt
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2252,7 +2252,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "television-derive"
|
name = "television-derive"
|
||||||
version = "0.0.26"
|
version = "0.0.27"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -31,7 +31,7 @@ build = "build.rs"
|
|||||||
path = "television/lib.rs"
|
path = "television/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
television-derive = { path = "television-derive", version = "0.0.26" }
|
television-derive = { path = "television-derive", version = "0.0.27" }
|
||||||
|
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
|
@ -1,31 +1,29 @@
|
|||||||
# Files
|
# Files
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "files"
|
name = "files"
|
||||||
source_command = "Get-ChildItem -Recurse -File"
|
source_command = "Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName"
|
||||||
preview_command = ":files:"
|
preview_command = ":files:"
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "dirs"
|
name = "dirs"
|
||||||
source_command = "Get-ChildItem -Recurse -Directory"
|
source_command = "Get-ChildItem -Recurse -Directory | Select-Object -ExpandProperty FullName"
|
||||||
preview_command = "Get-ChildItem -Force -LiteralPath '{}' | Format-List"
|
preview_command = "ls -l {0}"
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "env"
|
name = "env"
|
||||||
source_command = "Get-ChildItem Env:"
|
source_command = "Get-ChildItem Env:"
|
||||||
preview_command = "$env:{0} -split ';'"
|
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "aliases"
|
name = "aliases"
|
||||||
source_command = "Get-Alias"
|
source_command = "Get-Alias"
|
||||||
interactive = true
|
|
||||||
|
|
||||||
# GIT
|
# GIT
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "git-repos"
|
name = "git-repos"
|
||||||
source_command = "Get-ChildItem -Recurse -Directory -Force -ErrorAction SilentlyContinue | Where-Object { Test-Path \"$($_.FullName)\\.git\" } | Select-Object -ExpandProperty FullName"
|
source_command = "Get-ChildItem -Path 'C:\\Users' -Recurse -Directory -Force -ErrorAction SilentlyContinue | Where-Object { Test-Path \"$($_.FullName)\\.git\" } | Select-Object -ExpandProperty FullName"
|
||||||
preview_command = "cd '{}' ; git log -n 200 --pretty=medium --all --graph --color"
|
preview_command = "cd '{}' ; git log -n 200 --pretty=medium --all --graph --color"
|
||||||
|
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
@ -54,12 +52,6 @@ name = "docker-images"
|
|||||||
source_command = "docker image ls --format '{{.ID}}'"
|
source_command = "docker image ls --format '{{.ID}}'"
|
||||||
preview_command = "docker image inspect {0} | jq -C"
|
preview_command = "docker image inspect {0} | jq -C"
|
||||||
|
|
||||||
# S3
|
|
||||||
[[cable_channel]]
|
|
||||||
name = "s3-buckets"
|
|
||||||
source_command = "aws s3 ls | ForEach-Object { ($_ -split '\s+')[-1] }"
|
|
||||||
preview_command = "aws s3 ls s3://{0}"
|
|
||||||
|
|
||||||
# Dotfiles (adapted to common Windows dotfile locations)
|
# Dotfiles (adapted to common Windows dotfile locations)
|
||||||
[[cable_channel]]
|
[[cable_channel]]
|
||||||
name = "my-dotfiles"
|
name = "my-dotfiles"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "television-derive"
|
name = "television-derive"
|
||||||
version = "0.0.26"
|
version = "0.0.27"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "The revolution will be televised."
|
description = "The revolution will be televised."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
use tracing::warn;
|
||||||
|
|
||||||
use super::shell::Shell;
|
use super::shell::Shell;
|
||||||
|
|
||||||
pub fn shell_command(interactive: bool) -> Command {
|
pub fn shell_command(interactive: bool) -> Command {
|
||||||
@ -17,5 +20,10 @@ pub fn shell_command(interactive: bool) -> Command {
|
|||||||
cmd.arg("-i");
|
cmd.arg("-i");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
if interactive {
|
||||||
|
warn!("Interactive mode is not supported on Windows.");
|
||||||
|
}
|
||||||
|
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user