File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1- use ./ Package .nu package-plugin
1+ use Package .nu package-plugin
22
33def main [-- ue-install-dir : string ] {
4- package-plugin -- ue-install-dir $ue_install_dir
4+ let info = package-plugin -- ue-install-dir $ue_install_dir ;
5+ let engine_plugins_dir = [$info.ue_install , " Engine" , " Plugins" ] | path join ;
6+ let plugin_extract_dir = [$engine_plugins_dir , $info.plugin_name ] | path join ;
7+
8+ print $" Extracting ($info.plugin_name ) to ($plugin_extract_dir )" ;
9+ mkdir $plugin_extract_dir ;
10+ tar - xf $info.plugin_archive - C $plugin_extract_dir ;
11+ print $" (ansi green )Unreal ($info.plugin_name ) successfully installed to ($engine_plugins_dir )(ansi reset )" ;
512}
Original file line number Diff line number Diff line change @@ -29,14 +29,16 @@ def ue-tool-extension [] {
2929 }
3030}
3131
32- def package-plugin [-- ue-install-dir : string ] {
32+ export def package-plugin [-- ue-install-dir : string ] {
3333 let install_dirs = if $ue_install_dir != null { [$ue_install_dir ] } else { get-ue-install-dirs };
3434 let plugin_dir = $env .FILE_PWD | path join ' ..' | path expand ;
3535 let dist_dir = [$plugin_dir , ' Dist' ] | path join ;
3636 mkdir $dist_dir ;
3737 let dist_archive = [$plugin_dir , ' Dist' , $" EcsactUnreal-(get-ue-os ).zip" ] | path join ;
3838 cd $plugin_dir ;
39- let plugin_descriptor = [$plugin_dir , (ls *.uplugin ).0.name ] | path join ;
39+ let plugin_descriptor_filename = (ls *.uplugin ).0.name ;
40+ let plugin_name = $plugin_descriptor_filename | split row " .uplugin" | get 0 ;
41+ let plugin_descriptor = [$plugin_dir , $plugin_descriptor_filename ] | path join ;
4042 let temp_package_dir = mktemp - d -- suffix ' EcsactUnrealPluginPackage' ;
4143
4244 if ($install_dirs | length ) == 0 {
@@ -61,6 +63,7 @@ def package-plugin [--ue-install-dir: string] {
6163
6264 return {
6365 ue_install : $install_dir ,
66+ plugin_name : $plugin_name ,
6467 plugin_archive : $dist_archive ,
6568 };
6669}
You can’t perform that action at this time.
0 commit comments