Skip to content

Commit c885ac3

Browse files
committed
mpremote/tests/test_mip_local_install: Fix path quoting.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
1 parent a459dd7 commit c885ac3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tools/mpremote/tests/test_mip_local_install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
set -e
88

99
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}"
1212

1313
target=/__ramdisk
1414
block_size=512
@@ -39,14 +39,14 @@ import os
3939
4040
bdev = RAMBlockDev(${block_size}, ${num_blocks})
4141
os.VfsFat.mkfs(bdev)
42-
os.mount(bdev, '${target}')
42+
os.mount(bdev, ${target@Q})
4343
EOF
4444

4545
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
5050
{
5151
"urls": [
5252
["${PACKAGE}/__init__.py", "${PACKAGE}/__init__.py"],
@@ -57,11 +57,11 @@ cat > ${PACKAGE_DIR}/package.json <<EOF
5757
EOF
5858

5959
$MPREMOTE run "${TMP}/ramdisk.py"
60-
$MPREMOTE resume mkdir ${target}/lib
60+
$MPREMOTE resume mkdir "${target}/lib"
6161
echo
6262
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"
6464
echo
6565
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')"
6767
$MPREMOTE resume exec "import ${PACKAGE}; ${PACKAGE}.hello()"

0 commit comments

Comments
 (0)