Skip to content

Commit ba09606

Browse files
committed
sample json and handle spaces
1 parent 08ff360 commit ba09606

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

scripts/prep-samples.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ const samplesMd = path.join(__dirname, '..', 'docs', 'samples.md');
4242
let samplesMdContents = fs.readFileSync(samplesMd, 'utf8');
4343
samplesMdContents += `<Samples samples={${stringified}} />`;
4444
fs.writeFileSync(samplesMd, samplesMdContents);
45+
46+
// save the json to the samples.json file in static
47+
fs.writeFileSync(path.join(__dirname, '..', 'static', 'samples.json'), stringified);

src/components/Samples/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default function Samples({ samples }: SamplesProps) {
159159
Clone and open the sample in your terminal
160160
</small>
161161
<CodeBlock language="bash">
162-
{`git clone https://github.com/defang-io/defang dtmp && cp -r defang/samples/${selectedSample.category}/${selectedSample.name} ./${selectedSample.name} && rm -r ./dtmp && cd ${selectedSample.name}`}
162+
{`git clone https://github.com/defang-io/defang dtmp && cp -r defang/samples/${selectedSample.category}/${selectedSample.name} "./${selectedSample.name}" && rm -r ./dtmp && cd "${selectedSample.name}"`}
163163
</CodeBlock>
164164
</Box>
165165
{/* </Stack> */}

0 commit comments

Comments
 (0)