Carglglz / upydev

Command line tool for MicroPython devices
https://pypi.org/project/upydev/
MIT License
57 stars 9 forks source link

New watch put mode for -fre flag #16

Closed Carglglz closed 4 years ago

Carglglz commented 4 years ago

Use flag -wdl as upydev put -fre cwd -wdl to create or check a log file in cwd so next time this command is used, only new or modified files will be upload.

e.g.:

▏████████████████████████████████████████████████████████████████▏ \ 100 % | 0.01/0.01 KB | 25.91 KB/s | 00:00/00:00 s

File Uploaded!

Uploading file wdl_script.py... op:put, host:192.168.1.53, port:8266, passwd:****. wdl_script.py -> /wdl_script.py Remote WebREPL version: (1, 12, 0)

▏████████████████████████████████████████████████████████████████▏ \ 100 % | 0.02/0.02 KB | 35.45 KB/s | 00:00/00:00 s

File Uploaded!

Rebooting upy device... Done!


- Next time no modified or new files:

$ upydev put -fre cwd -wdl Files in cwd to upload: Checking upydev cwd watchdog logfile... No new or modified files found

- Next time if modified or new files:

$ upydev put -fre cwd -wdl Files in cwd to upload: Checking upydev cwd watchdog logfile... Modified files to upload:

Uploading file wdl_script.py... op:put, host:192.168.1.53, port:8266, passwd:****. wdl_script.py -> /wdl_script.py Remote WebREPL version: (1, 12, 0)

▏████████████████████████████████████████████████▏ \ 100 % | 0.10/0.10 KB | 83.21 KB/s | 00:00/00:00 s

File Uploaded!

Rebooting upy device... Done!

Carglglz commented 4 years ago

@stsdc Now $ upydev d_sync -wdl works too.

So you can cd into src and do $ upydev d_sync -wdl It will create a log file in every directory with the name and hash of each file, so next time the command is run, only new or changed files are uploaded, then the log is updated.

$ tree -a
 ./
   ├── ble
   │   ├── ble_advertising.py
   │   ├── ble.py
   │   ├── ble_temperature.py
   |   └── .upydev_wdlog.json 
   ├── boot.py
   ├── main.py
   └── .upydev_wdlog.json