@@ -966,17 +966,17 @@ def run(self, parsed_args: "Namespace") -> None:
966966 )
967967
968968 # Export a temporary bundle file with the charms in the target channel
969- with tempfile .TemporaryDirectory () as bundle_dir :
970- bundle_dir_path = pathlib .Path (bundle_dir )
971- shutil .copy (self .config .project_dir , bundle_dir_path )
969+ with tempfile .TemporaryDirectory (prefix = "charmcraft-" ) as bundle_dir :
970+ bundle_dir_path = pathlib .Path (bundle_dir ) / bundle_name
971+ shutil .copytree (self .config .project . dirpath , bundle_dir_path )
972972 bundle_path = bundle_dir_path / "bundle.yaml"
973973 with bundle_path .open ("w+" ) as bundle_file :
974974 yaml .dump (bundle_config , bundle_file )
975975
976976 # Pack the bundle using the modified bundle file
977977 emit .verbose (f"Packing temporary bundle in { bundle_dir } ..." )
978978 lifecycle = parts .PartsLifecycle (
979- bundle_config ,
979+ {} ,
980980 work_dir = bundle_dir_path / "build" ,
981981 project_dir = bundle_dir_path ,
982982 project_name = bundle_name ,
@@ -991,12 +991,12 @@ def run(self, parsed_args: "Namespace") -> None:
991991 from charmcraft .manifest import create_manifest
992992
993993 create_manifest (lifecycle .prime_dir , self .config .project .started_at , None , [])
994- zipname = self . config . project . dirpath / (bundle_name + ".zip" )
994+ zipname = bundle_dir_path / (bundle_name + ".zip" )
995995 build_zip (zipname , lifecycle .prime_dir )
996996
997997 # Upload the bundle and release it to the target channel.
998- store .upload (self . config . name , bundle_path )
999- store .release (self . config . name , bundle_revision , parsed_args .to_channel , [])
998+ store .upload (bundle_name , zipname )
999+ store .release (bundle_name , bundle_revision , [ parsed_args .to_channel ] , [])
10001000
10011001
10021002class CloseCommand (BaseCommand ):
0 commit comments