7
7
set -e
8
8
9
9
PACKAGE=mip_example
10
- PACKAGE_DIR=${TMP} /example
11
- MODULE_DIR=${PACKAGE_DIR} /${PACKAGE}
10
+ PACKAGE_DIR=" ${TMP} /example"
11
+ MODULE_DIR=" ${PACKAGE_DIR} /${PACKAGE} "
12
12
13
13
target=/__ramdisk
14
14
block_size=512
@@ -39,14 +39,14 @@ import os
39
39
40
40
bdev = RAMBlockDev(${block_size} , ${num_blocks} )
41
41
os.VfsFat.mkfs(bdev)
42
- os.mount(bdev, ' ${target} ' )
42
+ os.mount(bdev, ${target@ Q} )
43
43
EOF
44
44
45
45
echo ----- Setup
46
- mkdir -p ${MODULE_DIR}
47
- echo " def hello(): print('Hello, world!')" > ${MODULE_DIR} /hello.py
48
- echo " from .hello import hello" > ${MODULE_DIR} /__init__.py
49
- cat > ${PACKAGE_DIR} /package.json << EOF
46
+ mkdir -p " ${MODULE_DIR} "
47
+ echo " def hello(): print('Hello, world!')" > " ${MODULE_DIR} /hello.py"
48
+ echo " from .hello import hello" > " ${MODULE_DIR} /__init__.py"
49
+ cat > " ${PACKAGE_DIR} /package.json" << EOF
50
50
{
51
51
"urls": [
52
52
["${PACKAGE} /__init__.py", "${PACKAGE} /__init__.py"],
@@ -57,11 +57,11 @@ cat > ${PACKAGE_DIR}/package.json <<EOF
57
57
EOF
58
58
59
59
$MPREMOTE run " ${TMP} /ramdisk.py"
60
- $MPREMOTE resume mkdir ${target} /lib
60
+ $MPREMOTE resume mkdir " ${target} /lib"
61
61
echo
62
62
echo ---- Install package
63
- $MPREMOTE resume mip install --target=${target} /lib ${PACKAGE_DIR} /package.json
63
+ $MPREMOTE resume mip install --target=" ${target} /lib" " ${PACKAGE_DIR} /package.json"
64
64
echo
65
65
echo ---- Test package
66
- $MPREMOTE resume exec " import sys; sys.path.append(\" ${target} /lib\" )"
66
+ $MPREMOTE resume exec " import sys; sys.path.append(${target@ Q} + ' /lib' )"
67
67
$MPREMOTE resume exec " import ${PACKAGE} ; ${PACKAGE} .hello()"
0 commit comments