Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Proposal: per-task shell/interpreter selection (bash/zsh/pwsh/node) + explicit script mode

Aperta
#275 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust, shell
Ambito
cli, tooling

Direzione di ricerca

Inizia da crates/vite_task_plan/src/plan.rs e PR #100 per comprendere la gestione esistente del fallback e degli argomenti della shell. Il MVP è completo quando una shell opzionale per attività esegue il comando come un unico script mantenendo il comportamento predefinito; la sintassi e l’interazione con le altre modalità richiedono ancora decisioni di progettazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Vite Tasks currently tries to parse commands statically (e.g. && lists) and otherwise falls back to running a shell (/bin/sh -c on Unix or cmd.exe /c on Windows).
However, many real-world tasks need:

  • PowerShell on Windows,
  • bash-specific features on Unix (vs /bin/sh),
  • or explicit “always run as script” mode (never try to split/parse).

Not being able to choose the interpreter makes scripts less portable and pushes authors to wrap everything manually.

Evidence (primary)

  • Plan has a hard-coded fallback to /bin/sh -c or cmd.exe /c.

Refs:

Proposed behavior (Unspecified syntax)

Add an optional per-task configuration, e.g.:

  • shell: "bash -c" or shell: ["powershell.exe","-NoLogo","-Command"]
    and/or an execution mode:
  • mode: "auto" (current behavior),
  • mode: "shell" (always run as script via chosen shell),
  • mode: "spawn" (strict direct spawn; fail if not representable)

Use cases

  • Windows repos standardizing on PowerShell scripts
  • bash-only constructs (process substitution, arrays, [[ ... ]], etc.)
  • Avoiding accidental fallback when a task should be strictly spawnable

Backward compatibility

  • Default remains current behavior (auto).
  • Opt-in only changes behavior for tasks that specify shell/mode.

Minimal implementation suggestion (MVP)

  • Implement shell override for the existing fallback pipeline first:
    if shell is set, run the task command as one script in that shell (no splitting).
  • Later iterations can decide whether/how to combine with && splitting and caching.
Lingua principale
Rust
Stelle
466
Fork
42
Merge medio
2g 6h
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di voidzero-dev/vite-task

Tutte le issue di voidzero-dev/vite-task

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.