espruino / EspruinoTools

JavaScript library of tools for Espruino - used for the Web IDE, CLI, etc.
Apache License 2.0
150 stars 89 forks source link

local modules are not found during Command-line Tool uploads #140

Closed MaBecker closed 3 years ago

MaBecker commented 3 years ago

Want to upload code from project folder as used with the chrome WebIDE via Espruino Command-line Tool 0.1.38

espruino -p "f6-70-dd-1b-5a-a0"  project/mycode.js
Espruino Command-line Tool 0.1.38
-----------------------------------

Connecting to 'f6-70-dd-1b-5a-a0'
--] <- Serial1
Connected
********************************************************************
* No list of built-in modules found. If you get 'Module not found' *
* messages for built-in modules you may want to connect to a board *
* with '-p devicePath' or use '--board BOARDNAME'                  *
********************************************************************
Module MYMODULE not found

How to tell the Command-line Tool to use the module from the local module folder?

MaBecker commented 3 years ago

What about a "MODULE_PATH" additional toMODULE_URL`?

https://github.com/espruino/EspruinoTools/blob/d0d5b1fe1efbac035c3cce12e6ab46bd0673d3d7/configDefaults.json#L29

MaBecker commented 3 years ago

Or add project path?

MaBecker commented 3 years ago

ok, next time better read about all the detail/notes and than ask questions.

This section completely solve the request:

MODULE_URL accepts a pipe delimited (|) list of URLS, including local servers and absolute or relative paths based on the code file. For example, "../../modules|http://localhost:8080/modules|http://www.espruino.com/modules" will first look in the module folder located two folders up from the code, then query the localhost server, and then look in the Espruino repository.

gfwilliams commented 3 years ago

By default it also looks in a folder called modules I believe