Skip to content

Commit

Permalink
Repair attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalikL committed Sep 10, 2024
1 parent 41101cb commit 36a8277
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ops/sync/transfer-document-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ let transferDocumentAssets = async function () {
? `${SOURCE_DIR}/${assetResourcePath.language}/${assetResourcePath.type}/${assetResourcePath.title}/${RESOURCE_ASSETS_DIRNAME}/`
: `${SOURCE_DIR}/${assetResourcePath.language}/${assetResourcePath.type}/${assetResourcePath.title}/${RESOURCE_CONTENT_DIRNAME}/${assetResourcePath.document}/`

let targetReplaceDir = documentImageAsset.indexOf(`${assetResourcePath.title}/assets`) > 0
? `${SOURCE_DIR}/${assetResourcePath.language}/${assetResourcePath.type}/${assetResourcePath.title}/${RESOURCE_CONTENT_DIRNAME}/**`
: `${SOURCE_DIR}/${assetResourcePath.language}/${assetResourcePath.type}/${assetResourcePath.title}/${RESOURCE_CONTENT_DIRNAME}/${assetResourcePath.document}`

let targetImage = path.basename(documentImageAsset)

let remoteURL =
Expand Down Expand Up @@ -107,7 +111,7 @@ let transferDocumentAssets = async function () {
*/

commands.push(`aws s3 cp ${documentImageAsset} ${remoteURL.replace(MEDIA_URL, REMOTE_MEDIA_URL)} --acl "public-read" --region us-east-1 --no-progress`)
commands.push(`sed -i -e 's/\\([ [(:]\\)${escapeAssetPathForSed(targetImage)}/\\1${escapeAssetPathForSed(remoteURL)}/g' ${assetDir}**/*.md && rm ${documentImageAsset}`)
commands.push(`sed -i -e 's/\\([ [(:]\\)${escapeAssetPathForSed(targetImage)}/\\1${escapeAssetPathForSed(remoteURL)}/g' ${targetReplaceDir}/*.md && rm ${documentImageAsset}`)
}

console.log(`${commands.join("\n")}`)
Expand Down
2 changes: 1 addition & 1 deletion src/en/devo/test/content/blocks/blocks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Test document2
title: Test document3
---

{"style":{"text": {"typeface":"Omnes-BlackItalic", "color": "#E5723F", "size": "xl"}}}
Expand Down

0 comments on commit 36a8277

Please sign in to comment.