Skip to content

Commit a41c8e3

Browse files
committed
fix: improved handling of relative paths and relpaths to guidebook stores
1 parent 25a1f7b commit a41c8e3

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

bin/codeflare

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ fi
126126

127127
export CODEFLARE_HEADLESS_ZIP=$HEADLESS/../headless.zip
128128

129+
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
130+
if [ -d "$SCRIPTDIR"/../store ]; then
131+
export GUIDEBOOK_STORE="$SCRIPTDIR"/../store
132+
else
133+
export GUIDEBOOK_STORE=git
134+
fi
135+
129136
# check if the user wants us to run the headless version (currently
130137
# indicated by the -c option)
131138
while getopts "c" opt

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"postinstall": "npm run compile",
3131
"format": "prettier --write '**/*.{scss,css,html,js,json,md,ts,tsx}'",
3232
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
33-
"open": "electron . shell",
33+
"open": "./bin/codeflare shell",
3434
"start": "WATCH_ARGS='-open' npm run watch",
3535
"mirror": "T=$(mktemp -d); (cd $T && git clone --depth=1 git@github.com:guidebooks/store.git) && echo \"mirror stage in $T/store\" && ./bin/madwizard.js mirror $T/store/guidebooks ./store",
3636
"mirror-if-needed": "if [ ! -d ./store ]; then npm run mirror; fi",

plugins/plugin-madwizard/src/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { resolve } from "path"
1817
import { Arguments, ReactResponse, Registrar, Tab } from "@kui-shell/core"
1918
import { setTabReadonly } from "./util"
2019

@@ -24,7 +23,7 @@ function withFilepath(readonly: boolean, cb: (filepath: string, tab: Tab) => Pro
2423
setTabReadonly({ tab })
2524
}
2625
return {
27-
react: await cb(resolve(argvNoOptions[1]), tab),
26+
react: await cb(argvNoOptions[1], tab),
2827
}
2928
}
3029
}

plugins/plugin-madwizard/src/read.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
export default async function read(filepath: string) {
1818
const { blockify, reader } = await import("madwizard")
19-
return blockify(filepath, await reader())
19+
return blockify(filepath, await reader(), undefined, undefined, { store: process.env.GUIDEBOOK_STORE })
2020
}

0 commit comments

Comments
 (0)