-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install Theme no matter if the user run the npx create-wp-project command in the wrong folder #820
Install Theme no matter if the user run the npx create-wp-project command in the wrong folder #820
Conversation
Frontend libs 9.5.0
Revert "Frontend libs 9.5.0"
FE libs 9.6.0 - Git untagling pt2
Develop -> Main sync
Main branch sync
// Check if you are in the required folder. | ||
const { path: requiredPath, isCorrectFolder } = await installPath('themes'); | ||
|
||
if (!isCorrectFolder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to allow users to set up the project from the root directory, without being required to be inside the theme folder. The installation process will ensure that the theme is placed in the correct location.
So if they setup the project from the root, wp-content, wp-content/plugins no mater the setup should go to the root of the project where the WP-config is set add add the theme to the correct place.
The same thing should work with the plugin flag used for the plugin setup
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #820 +/- ##
========================================
Coverage 25.04% 25.04%
========================================
Files 36 36
Lines 1206 1206
Branches 305 305
========================================
Hits 302 302
Misses 631 631
Partials 273 273
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -36,6 +36,39 @@ exports.handler = async (argv) => { | |||
await clearConsole(); | |||
await writeIntro(); | |||
|
|||
const fs = require('fs'); | |||
|
|||
const findProjectRoot = (currentDir) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how will this work with the plugin flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Plugins to be in a separate task, but putting everything together into one PR can also work, especially when the changes are closely connected and won't get confusing. So, we can go ahead with that approach :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, please wait for the review from @goranalkovic-infinum
I have used parts of your PR for the new release so I will not merge this but parts of this is in the new release. tnx |
Description
The task aims to create a Node.js function that identifies the root directory of a WordPress project by searching for the presence of the wp-config.php file. This functionality will facilitate automated processes within the project setup or maintenance scripts, ensuring they execute from the correct directory.
Screenshots / Videos
Screen.Recording.2024-04-25.at.11.09.27.mov
Productive
https://app.productive.io/1-infinum/tasks/7791999