@@ -94,22 +94,37 @@ pub fn install(sh: &Shell, flags: flags::Install) -> anyhow::Result<()> {
9494pub fn run ( sh : & Shell , flags : flags:: Run ) -> anyhow:: Result < ( ) > {
9595 let err_context = || format ! ( "failed to run pipeline 'run' with args {flags:?}" ) ;
9696
97- build:: build (
98- sh,
99- flags:: Build {
100- release : false ,
101- no_plugins : false ,
102- plugins_only : true ,
103- } ,
104- )
105- . and_then ( |_| crate :: cargo ( ) )
106- . and_then ( |cargo| {
107- cmd ! ( sh, "{cargo} run --" )
108- . args ( & flags. args )
109- . run ( )
110- . map_err ( anyhow:: Error :: new)
111- } )
112- . with_context ( err_context)
97+ if let Some ( ref data_dir) = flags. data_dir {
98+ let data_dir = sh. current_dir ( ) . join ( data_dir) ;
99+
100+ crate :: cargo ( )
101+ . and_then ( |cargo| {
102+ cmd ! ( sh, "{cargo} run" )
103+ . args ( [ "--package" , "zellij" ] )
104+ . args ( [ "--features" , "disable_automatic_asset_installation" ] )
105+ . args ( [ "--" , "--data-dir" , & format ! ( "{}" , data_dir. display( ) ) ] )
106+ . run ( )
107+ . map_err ( anyhow:: Error :: new)
108+ } )
109+ . with_context ( err_context)
110+ } else {
111+ build:: build (
112+ sh,
113+ flags:: Build {
114+ release : false ,
115+ no_plugins : false ,
116+ plugins_only : true ,
117+ } ,
118+ )
119+ . and_then ( |_| crate :: cargo ( ) )
120+ . and_then ( |cargo| {
121+ cmd ! ( sh, "{cargo} run --" )
122+ . args ( & flags. args )
123+ . run ( )
124+ . map_err ( anyhow:: Error :: new)
125+ } )
126+ . with_context ( err_context)
127+ }
113128}
114129
115130/// Bundle all distributable content to `target/dist`.
@@ -146,6 +161,7 @@ pub fn dist(sh: &Shell, _flags: flags::Dist) -> anyhow::Result<()> {
146161pub fn publish ( sh : & Shell , flags : flags:: Publish ) -> anyhow:: Result < ( ) > {
147162 let err_context = "failed to publish zellij" ;
148163
164+ sh. change_dir ( crate :: project_root ( ) ) ;
149165 let dry_run = if flags. dry_run {
150166 Some ( "--dry-run" )
151167 } else {
0 commit comments