Delete orphaned page on translated-content fails unless CONTENT_TRANSLATED_ROOT is an absolute path
See original GitHub issueSteps to reproduce
- Set up both repositories (mdn/content and mdn/translated-content) (incl. installing node, yarn)
- Set up .env file accordingly (
CONTENT_TRANSLATED_ROOT=../translated-content/files
) - Check some orphaned pages which are obsolete under fr
- Run
yarn content delete orphaned/Learn/How_to_contribute fr
from translated-content local directory. Got ‘Command content not found’ - Move to content directory
- Run
yarn content delete orphaned/Learn/How_to_contribute fr
- Confirm the deletion
Actual result
Failed with
Error running git rm,-r,../translated-content/files/fr/orphaned/learn/how_to_contribute
<Buffer … more bytes>
error: git command failed: fatal: ../translated-content/files/fr/orphaned/learn/how_to_contribute : '../translated-content/files/fr/orphaned/learn/how_to_contribute' est hors du dépôt
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Sorry for the French here: the git command fails because the path is outside of the repository.
Expected result
Deletion goes smoothly and I’m able to submit a corresponding PR on mdn/translated-content
The thing is that I don’t know where this issue belongs:
- mdn/yari where cli.js is defined
- mdn/content where package.json includes the
content
script - mdn/translated-content which has nothing of that.
Let me know where this should go (if not here) so that I can work on a fix.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Multisite: How to delete orphaned records of pages?
Ensure to have a backup of the database and the project before proceeding with the below steps. 1. Find the Id of the...
Read more >How to Find and Fix Orphan Pages (The Right Way) - Ahrefs
Failing to remove internal links to such products is a common cause of orphan pages. If the page has great backlinks and there...
Read more >Orphan Pages & SEO | How to Find and Fix Orphan ... - Botify
Here's how. How to find orphan pages. If a site crawler helps you find pages in your site structure, then a log file...
Read more >How to Find Every Orphan Page on Your Website
A page without any links to it is called an orphan page. Here's how to find all of your orphan pages and why...
Read more >Orphaned Content Pages in WordPress & How to Fix Them
If you are trying to improve your website's SEO, then you need to fix orphaned pages in WordPress. This guide can show you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we should treat that as a bug. It’s nice to know you can unblock yourself by making it absolute but it seems like it should be fixed. For example, we have that code that checks if the
CONTENT_ROOT
was lacking thefiles
suffix. I think we should do something similar to CONTEN_TRANSLATED_ROOT.@fiji-flo Would you mind looking into it?
In
content/constants.js
we check thatfs.existsSync(CONTENT_TRANSLATED_ROOT)
but it still managed to crash because the context (aka current working directory) in which thedelete
was run isn’t the same as when things started up.I wonder if we can do this:
Would that have solved the bug?