8000 Change `--listfile` CLI option to expect array · arduino/micropython.js@bec22c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit bec22c3

Browse files
committed
Change --listfile CLI option to expect array
1 parent 4eafbd3 commit bec22c3

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

cli.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ const extractCommands = (args) => {
2626
return commands
2727
}
2828

29-
const extractFileArray = (output) => {
30-
output = output.replace(/'/g, '"');
31-
output = output.split('OK')
32-
let files = output[2] || ''
33-
files = files.slice(0, files.indexOf(']')+1)
34-
files = JSON.parse(files)
35-
return files
36-
}
37-
3829
function ensurePort(port) {
3930
if (!port) throw new Error('You must specify a port.')
4031
}
@@ -55,8 +46,7 @@ const listFiles = (args, port) => {
5546
const folder = args[0] || '/'
5647
try {
5748
const output = await board.fs_ls(folder)
58-
const files = extractFileArray(output)
59-
console.log(`files at "${folder}"`, files)
49+
console.log(`files at "${folder}"`, output)
6050
} catch(e) {
6151
console.log('error', e)
6252
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "micropython.js",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Interpretation of pyboard.py in javascript",
55
"main": "micropython.js",
66
"scripts": {

0 commit comments

Comments
 (0)
0