Skip to content

Commit

Permalink
fix: doctor shows the current environment of Moddable SDK (#205)
Browse files Browse the repository at this point in the history
* fixed: xs-dev doctor shows the current environment

"xs-dev doctor" or "xs-dev info" displays the current environment setup information.
After setup of Moddable SDK, it works on Mac environment but doesn't work on Linux and Windows.

example on Mac
% xs-dev doctor
xs-dev environment info:
  CLI Version                0.36.2                                                                      
  OS                         Darwin                                                                      
  Arch                       arm64                                                                       
  Shell                      /bin/zsh                                                                    
  NodeJS Version             v20.14.0 (/Users/kitazaki/.nodebrew/current/bin/node)                       
  Python Version             3.13.0 (/Users/kitazaki/.espressif/python_env/idf5.3_py3.13_env/bin/python) 
  Moddable SDK Version       5.3.3 (/Users/kitazaki/.local/share/moddable)                               
  Supported target devices   mac

example on Linux
$ xs-dev doctor
xs-dev environment info:
  CLI Version                0.36.2                                             
  OS                         Linux                                              
  Arch                       x64                                                
  Shell                      /bin/bash                                          
  NodeJS Version             v22.12.0 (/home/ubuntu/.nodebrew/current/bin/node) 
  Python Version             3.10.12 (/usr/bin/python)                          
  Moddable SDK Version       Not found (/home/ubuntu/.local/share/moddable)     
  Supported target devices   None                                               

This change fixes the issue.
platformDir is build/bin directory of Moddable SDK and defined in xs-dev/build/src/toolbox/setup/moddable.ts
platformDir reads DEVICE_ALIAS[OS] which is defined in xs-dev/src/toolbox/prompt/devices.ts
Exact directories are mac, lin and win, but definitions are mac, linux and windows.
  • Loading branch information
kitazaki authored Jan 3, 2025
1 parent c266f0c commit dd56f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/toolbox/setup/moddable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const finishedPromise = promisify(finished)

export function moddableExists(): boolean {
const OS = platformType().toLowerCase() as Device
const platformDir = DEVICE_ALIAS[OS]
const platformDir = DEVICE_ALIAS[OS].substr(0,3)
const releaseTools = filesystem.exists(
filesystem.resolve(INSTALL_PATH, 'build', 'bin', platformDir, 'release'),
)
Expand Down

0 comments on commit dd56f7b

Please sign in to comment.