From a9f6c0feb5637ac15e115e04c1062df887b7c34f Mon Sep 17 00:00:00 2001 From: Chris McCord Date: Mon, 17 Jun 2024 14:12:38 -0400 Subject: [PATCH] Fix --- lib/flame/code_sync.ex | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/flame/code_sync.ex b/lib/flame/code_sync.ex index c32a615..bcd5a75 100644 --- a/lib/flame/code_sync.ex +++ b/lib/flame/code_sync.ex @@ -193,11 +193,20 @@ defmodule FLAME.CodeSync do :ok = :erl_tar.extract(target_tmp_path, [{:cwd, extract_dir}, :compressed | verbose]) + for mod <- pkg.purge_modules do + :code.purge(mod) + :code.delete(mod) + end + # add code paths :ok = add_code_paths_from_tar(pkg, extract_dir) # purge updated or deleted modules - purge(pkg, pkg.purge_modules) + for mod <- pkg.purge_modules do + # deleted beams being purged will passively return {:error, :nofile}, which is fine + :c.l(mod) + end + File.rm(target_tmp_path)