fix patch test
This commit is contained in:
56
install.zsh
56
install.zsh
@@ -276,6 +276,10 @@ function at-repos-patch-apply-all() {
|
||||
repo="atproto"
|
||||
elif [[ $filename == *"feed"* ]]; then
|
||||
repo="feed-generator"
|
||||
# feed-generatorパッチ適用前に既存のDockerfileを削除(upstreamと競合回避)
|
||||
if [[ $filename == "200-feed-generator-custom.patch" ]]; then
|
||||
rm -f "$d/repos/feed-generator/Dockerfile"
|
||||
fi
|
||||
fi
|
||||
|
||||
patch-apply "$title" "$repo" "$filename"
|
||||
@@ -331,6 +335,54 @@ export const SOCIAL_APP_DOMAIN =\
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
function at-repos-feed-generator-newfiles() {
|
||||
echo ""
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "📝 Creating feed-generator new files..."
|
||||
|
||||
# Create app.ts
|
||||
cat > $d/repos/feed-generator/src/algos/app.ts <<'EOF'
|
||||
import { QueryParams } from '../lexicon/types/app/bsky/feed/getFeedSkeleton'
|
||||
import { AppContext } from '../config'
|
||||
|
||||
// max 15 chars
|
||||
export const shortname = 'app'
|
||||
|
||||
export const handler = async (ctx: AppContext, params: QueryParams) => {
|
||||
let builder = ctx.db
|
||||
.selectFrom('post')
|
||||
.selectAll()
|
||||
.orderBy('indexedAt', 'desc')
|
||||
.orderBy('cid', 'desc')
|
||||
.limit(params.limit)
|
||||
|
||||
if (params.cursor) {
|
||||
const timeStr = new Date(parseInt(params.cursor, 10)).toISOString()
|
||||
builder = builder.where('post.indexedAt', '<', timeStr)
|
||||
}
|
||||
const res = await builder.execute()
|
||||
|
||||
const feed = res.map((row) => ({
|
||||
post: row.uri,
|
||||
}))
|
||||
|
||||
let cursor: string | undefined
|
||||
const last = res.at(-1)
|
||||
if (last) {
|
||||
cursor = new Date(last.indexedAt).getTime().toString(10)
|
||||
}
|
||||
|
||||
return {
|
||||
cursor,
|
||||
feed,
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "✅ Created src/algos/app.ts"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
}
|
||||
|
||||
function at-repos-build-docker-atproto() {
|
||||
cd $d
|
||||
docker image prune -a
|
||||
@@ -533,6 +585,7 @@ case "$1" in
|
||||
at-repos-social-app-ios-patch
|
||||
at-repos-patch-apply-all
|
||||
at-repos-ozone-patch
|
||||
at-repos-feed-generator-newfiles
|
||||
show-failed-patches
|
||||
exit
|
||||
;;
|
||||
@@ -561,7 +614,7 @@ esac
|
||||
case "`cat /etc/hostname`" in
|
||||
at)
|
||||
if [ "$1" = "bgs-reset" ];then
|
||||
at-repos-reset-bgs-db
|
||||
# at-repos-reset-bgs-db
|
||||
exit
|
||||
fi
|
||||
at-repos-pull-docker
|
||||
@@ -574,6 +627,7 @@ case "`cat /etc/hostname`" in
|
||||
at-repos-social-app-ios-patch
|
||||
at-repos-patch-apply-all
|
||||
at-repos-ozone-patch
|
||||
at-repos-feed-generator-newfiles
|
||||
show-failed-patches
|
||||
at-repos-build-docker-atproto
|
||||
at-repos-push-docker
|
||||
|
||||
Reference in New Issue
Block a user