Skip to content

Commit b754667

Browse files
committed
Install: Debug conda version
1 parent 2305f1f commit b754667

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

mhkit/package/+mhkit/install.m

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,20 @@ function install()
6363
if ~conda_env_exists
6464
logger.info('Creating environment "%s"...', conda_env_name);
6565
command = spec.conda.create;
66+
logger.info('Original command template: %s', command);
6667
command = replace(command, '<conda_env>', conda_env_name);
6768
command = replace(command, '<python_version>', spec.python.install_version);
68-
mhkit.sys(command);
69+
logger.info('Final conda create command: %s', command);
70+
logger.info('Using Python version: %s', spec.python.install_version);
71+
[status, output] = mhkit.sys(command);
72+
logger.info('Conda create exit status: %d', status);
73+
if ~isempty(output)
74+
logger.info('Conda create output: %s', output);
75+
end
76+
if status ~= 0
77+
logger.error('Conda create command failed!');
78+
return;
79+
end
6980
logger.info('✓ Environment created');
7081
else
7182
logger.info('✓ Environment "%s" ready', conda_env_name);
@@ -83,9 +94,20 @@ function install()
8394
logger.info('Recreating %s Conda environment', conda_env_name);
8495
mhkit.sys(sprintf('conda remove -n %s --all -y', conda_env_name));
8596
command = spec.conda.create;
97+
logger.info('Recreation - Original command template: %s', command);
8698
command = replace(command, '<conda_env>', conda_env_name);
8799
command = replace(command, '<python_version>', spec.python.install_version);
88-
mhkit.sys(command);
100+
logger.info('Recreation - Final conda create command: %s', command);
101+
logger.info('Recreation - Using Python version: %s', spec.python.install_version);
102+
[status, output] = mhkit.sys(command);
103+
logger.info('Recreation - Conda create exit status: %d', status);
104+
if ~isempty(output)
105+
logger.info('Recreation - Conda create output: %s', output);
106+
end
107+
if status ~= 0
108+
logger.error('Recreation - Conda create command failed!');
109+
return;
110+
end
89111
end
90112

91113
% Check if `mhkit` is in `conda list`

0 commit comments

Comments
 (0)