Skip to content

Commit

Permalink
Chore: Add fetch poky script
Browse files Browse the repository at this point in the history
  • Loading branch information
WilsonZiweiWang committed Mar 5, 2024
1 parent 162a86c commit d0bc2eb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"postinstall": "cd server && npm install && cd ../client && npm install",
"fetch": "npm run fetch:poky && npm run fetch:docs",
"fetch:docs": "sh scripts/fetch-docs.sh",
"fetch:poky": "mkdir -p resources/poky && curl -L -o resources/poky.tar.bz2 https://downloads.yoctoproject.org/releases/yocto/yocto-4.2.3/poky-aa63b25cbe25d89ab07ca11ee72c17cab68df8de.tar.bz2 && tar -xvjf resources/poky.tar.bz2 -C resources",
"fetch:poky": "sh scripts/fetch-poky.sh",
"compile": "npm run installServer && tsc -b",
"watch": "npm run installServer && tsc -b -w",
"installServer": "cd server && npm run installServer",
Expand Down
23 changes: 23 additions & 0 deletions scripts/fetch-poky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -e

# The latest tag starts with 'yocto' is easier to get from the 'yocto-docs' than from 'poky'
git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yocto-docs
cd yocto-docs
git fetch --tags
TMP_TAG=$(git tag | tail -n 1)
cd ..
rm -rf yocto-docs

git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git
cd poky
git fetch --tags
LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //")
LINK="https://downloads.yoctoproject.org/releases/yocto/$TMP_TAG/poky-$LASTEST_RELEASE.tar.bz2"
cd ..
rm -rf poky

mkdir -p resources/poky
curl -L -o resources/poky.tar.bz2 $LINK
tar -xvjf resources/poky.tar.bz2 -C resources

0 comments on commit d0bc2eb

Please sign in to comment.