René's URL Explorer Experiment


Title: fix(@angular/build): prevent deleting parent directories of project root by pradhankukiran · Pull Request #32873 · angular/angular-cli · GitHub

Open Graph Title: fix(@angular/build): prevent deleting parent directories of project root by pradhankukiran · Pull Request #32873 · angular/angular-cli

X Title: fix(@angular/build): prevent deleting parent directories of project root by pradhankukiran · Pull Request #32873 · angular/angular-cli

Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) PR Type What kind of change does this PR introduce? Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes Other... Please describe: What is the current behavior? The deleteOutputDir utility only checks if the output path is exactly equal to the project root. Setting the output path to a parent directory (e.g. ../ or ../../) bypasses this check, and ng build silently deletes all contents of that directory potentially wiping out source files or entire directory trees. Closes: #6485 What is the new behavior? Uses path.relative() to detect when the resolved output path is the project root OR any ancestor of it, and throws a descriptive error in both cases. Does this PR introduce a breaking change? Yes No Other information The original issue reported a user losing 10 days of work after setting outDir: "../../" which caused ng build --prod to delete their entire project directory. This fix closes the gap that has been open since 2017.

Open Graph Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-com...

X Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-com...

Opengraph URL: https://github.com/angular/angular-cli/pull/32873

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8f3a5f58-565e-ee64-214f-6caad5aa6936
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCA6A:6E631:13EADA8:1AF7565:6A62D1DE
html-safe-nonce7e5b89b281e4860ea3bfba02eb56151968fd621d71ce7c23ad9f74dc0750cb1a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTZBOjZFNjMxOjEzRUFEQTg6MUFGNzU2NTo2QTYyRDFERSIsInZpc2l0b3JfaWQiOiIyNDMxMDk3ODEyMjY2NzAxMjc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca5ea5cb354d05fcecc6802f39415f9d5a041fd667b2fba94303f60c903bb20f5
hovercard-subject-tagpull_request:3456638681
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/32873/files
twitter:imagehttps://avatars.githubusercontent.com/u/127883780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/127883780?s=400&v=4
og:image:altPR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-com...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonedf33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released41cd1bdb290013455c0ac430fa755621733f5eb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/32873/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F32873%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F32873%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/pull/32873/files
Reloadhttps://github.com/angular/angular-cli/pull/32873/files
Reloadhttps://github.com/angular/angular-cli/pull/32873/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 269 https://github.com/angular/angular-cli/issues
Pull requests 29 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality 5 https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security and quality https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
pradhankukiranhttps://github.com/pradhankukiran
angular:mainhttps://github.com/angular/angular-cli/tree/main
pradhankukiran:fix-delete-output-dir-ancestor-checkhttps://github.com/pradhankukiran/angular-cli/tree/fix-delete-output-dir-ancestor-check
Conversation 15 https://github.com/angular/angular-cli/pull/32873
Commits 5 https://github.com/angular/angular-cli/pull/32873/commits
Checks 6 https://github.com/angular/angular-cli/pull/32873/checks
Files changed https://github.com/angular/angular-cli/pull/32873/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
fix(@angular/build): prevent deleting parent directories of project root https://github.com/angular/angular-cli/pull/32873/files#top
Show all changes 5 commits https://github.com/angular/angular-cli/pull/32873/files
4886930 fix(@angular/build): prevent deleting parent directories of project root pradhankukiran Mar 27, 2026 https://github.com/angular/angular-cli/pull/32873/commits/4886930b4f7002caef69d252406a30e13d14f0c9
6c745cc fixup! fix(@angular/build): prevent deleting parent directories of pr… pradhankukiran Mar 27, 2026 https://github.com/angular/angular-cli/pull/32873/commits/6c745ccb202a5d06c038ddc6a3f1317bc4ed1230
a2b1fab fixup! fix(@angular/build): prevent deleting parent directories of pr… alan-agius4 Mar 27, 2026 https://github.com/angular/angular-cli/pull/32873/commits/a2b1fabab26449111761b0cbfe684b27d749178a
9d3f5d4 fix(@angular/build): handle Windows absolute paths in output dir check pradhankukiran Mar 27, 2026 https://github.com/angular/angular-cli/pull/32873/commits/9d3f5d4b34a40befdc461aa0e1e93e3383f44dcc
3a6d97a fixup! fix(@angular/build): prevent deleting parent directories of pr… pradhankukiran Mar 27, 2026 https://github.com/angular/angular-cli/pull/32873/commits/3a6d97a73b283f888baaca31391887a995ee8679
Clear filters https://github.com/angular/angular-cli/pull/32873/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
delete-output-dir.ts https://github.com/angular/angular-cli/pull/32873/files#diff-06670ea0bade7ba4b084a4fe977c282f1547c3fc84c4f2f825d944b625afdb9c
delete-output-dir_spec.ts https://github.com/angular/angular-cli/pull/32873/files#diff-c24629a652d528003d89bb7333cbaa326020714c9fa6e4a50def8c7138eea792
packages/angular/build/src/utils/delete-output-dir.tshttps://github.com/angular/angular-cli/pull/32873/files#diff-06670ea0bade7ba4b084a4fe977c282f1547c3fc84c4f2f825d944b625afdb9c
View file https://github.com/angular/angular-cli/blob/3a6d97a73b283f888baaca31391887a995ee8679/packages/angular/build/src/utils/delete-output-dir.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/32873/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/32873/files#diff-06670ea0bade7ba4b084a4fe977c282f1547c3fc84c4f2f825d944b625afdb9c
https://github.com/angular/angular-cli/pull/32873/files#diff-06670ea0bade7ba4b084a4fe977c282f1547c3fc84c4f2f825d944b625afdb9c
https://github.com/angular/angular-cli/pull/32873/files#diff-06670ea0bade7ba4b084a4fe977c282f1547c3fc84c4f2f825d944b625afdb9c
packages/angular/build/src/utils/delete-output-dir_spec.tshttps://github.com/angular/angular-cli/pull/32873/files#diff-c24629a652d528003d89bb7333cbaa326020714c9fa6e4a50def8c7138eea792
View file https://github.com/angular/angular-cli/blob/3a6d97a73b283f888baaca31391887a995ee8679/packages/angular/build/src/utils/delete-output-dir_spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/32873/{{ revealButtonHref }}
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/32873/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.