pub fn validate_bucket_location(bucket: &PathBuf) -> Result<(), failure::Error> {
    // TODO: this should really use a convenience function for "Wrangler Project Root"
    let current_dir = env::current_dir()?;
    if bucket.as_os_str() == current_dir {
        failure::bail!(
            "{} Your bucket cannot be set to the parent directory of your configuration file",
            emoji::WARN
        )
    }
    let path = Path::new(&bucket);
    if !path.exists() {
        failure::bail!(
            "{} bucket directory \"{}\" does not exist",
            emoji::WARN,
            path.display()
        )
    } else if !path.is_dir() {
        failure::bail!(
            "{} bucket \"{}\" is not a directory",
            emoji::WARN,
            path.display()
        )
    }

    Ok(())
}
// We don't want folks setting their bucket to the top level directory,
// which is where wrangler commands are always called from.
We don't want folks setting their bucket to the top level directory,
which is where wrangler commands are always called from.
We don ' t want folks setting their bucket to the top level directory which is where wrangler commands are always called from .
pub fn validate_bucket_location(bucket: &PathBuf) -> Result<(), failure::Error> {
    // TODO: this should really use a convenience function for "Wrangler Project Root"
    let current_dir = env::current_dir()?;
    if bucket.as_os_str() == current_dir {
        failure::bail!(
            "{} Your bucket cannot be set to the parent directory of your configuration file",
            emoji::WARN
        )
    }
    let path = Path::new(&bucket);
    if !path.exists() {
        failure::bail!(
            "{} bucket directory \"{}\" does not exist",
            emoji::WARN,
            path.display()
        )
    } else if !path.is_dir() {
        failure::bail!(
            "{} bucket \"{}\" is not a directory",
            emoji::WARN,
            path.display()
        )
    }
    Ok(())
}
pub fn validate_bucket_location ( bucket : & PathBuf ) -> Result < ( ) , failure :: Error > { // TODO: this should really use a convenience function for "Wrangler Project Root" let current_dir = env :: current_dir ( ) ? ; if bucket . as_os_str ( ) == current_dir { failure :: bail ! ( " " emoji WARN ) } let path = Path :: new ( & bucket ) ; if ! path . exists ( ) { failure :: bail ! ( " \" \" " emoji WARN path display ( ) ) } else if ! path . is_dir ( ) { failure :: bail ! ( " \" \" " emoji WARN path display ( ) ) } Ok ( ( ) ) }
We don't want folks setting their bucket to the top level directory,
which is where wrangler commands are always called from.
We don ' t want folks setting their bucket to the top level directory which is where wrangler commands are always called from .
bucket
&PathBuf