File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,4 @@ structopt = "0.3.*"
16
16
clap = " 2.33.*"
17
17
env_logger = " 0.7.*"
18
18
log = " 0.4.*"
19
+ shellexpand = " 1.1.*"
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ use args;
4
4
5
5
use toml:: value:: Table ;
6
6
7
- use std:: fs:: { self , canonicalize } ;
7
+ use std:: fs;
8
8
use std:: io:: { Read , Write , Seek } ;
9
9
use std:: path:: Path ;
10
10
use std:: process;
11
11
12
- use filesystem:: relativize;
12
+ use filesystem:: { canonicalize , relativize} ;
13
13
14
14
pub fn deploy ( cache_directory : & Path , cache : bool , opt : args:: GlobalOptions ) {
15
15
// Configuration
Original file line number Diff line number Diff line change
1
+ use shellexpand;
2
+
1
3
use std:: path:: { Path , PathBuf } ;
4
+ use std:: { io, fs} ;
5
+
6
+ pub fn canonicalize < P : AsRef < Path > > ( path : P ) -> Result < PathBuf , io:: Error > {
7
+ fs:: canonicalize ( shellexpand:: tilde ( & path. as_ref ( ) . to_string_lossy ( ) ) . into_owned ( ) )
8
+ }
2
9
3
10
pub fn relativize ( path : & Path ) -> PathBuf {
4
11
if path. is_relative ( ) {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ extern crate structopt;
5
5
extern crate env_logger;
6
6
#[ macro_use]
7
7
extern crate log;
8
+ extern crate shellexpand;
8
9
9
10
mod args;
10
11
mod config;
You can’t perform that action at this time.
0 commit comments