make target_dir work which overrides script-type if its set, required
for script_id 2372