pushd

Crates.iopushd
lib.rspushd
version
sourcesrc
created_at2023-11-06 03:27:43.375834
updated_at2024-12-08 20:31:07.543952
descriptionA library that implements pushd
homepage
repositoryhttps://github.com/houseabsolute/pushd
max_upload_size
id1026324
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Dave Rolsky (autarch)

documentation

README

pushd

A simple library for temporarily changing the current working directory.

Usage

Add this to your Cargo.toml:

[dependencies]
pushd = "0.0.1"

Example

use anyhow::Result
use std::path::PathBuf;
use pushd::Pushd;

fn main() -> Result<()> {
    write_in_etc()?;
    // Current working directory is whatever it was before the call to
    // `write_in_etc`.
}

fn write_in_etc() -> Result<()> {
    let path = PathBuf::new("/etc");
    let _pd = Pushd::new(path)?;
    // Current working directory is now /etc
    //
    // Do something in /etc.
}
Commit count: 14

cargo fmt