-
Notifications
You must be signed in to change notification settings - Fork 374
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
feat: support default path environment variable #1652
Conversation
@a-b-r-o-w-n I changed the condition in the migration. The previous one would only check whether the data.json contain the defaultPath. But we still need to set it if the defaultPath changed by user. And I added the following code. The issue is quite odd here: if user set the defaultPath as D: we use fs.existsSync('D:') in many places to check whether the path is valid, and it will return true. However, Path.resolve('D:') will return the current folder D:\BotFramework-Composer\Composer\packages\server>, which means for path module D: is invalid. I feel the fs and path module are not designed consistent. I searched online but cannot find an elegant way to solve this. I checked our code in the FileSelector.tsx we have itemPath = itemPath[itemPath.length - 1] === ':' ? it can be reproduced by setting the COMPOSER_BOTS_FOLDER D: and do the migration. Go to localhost:3000, click New, Click next. The location there is not D: but D:\BotFramework-Composer\Composer\packages\server> |
add interface for settings to catch this at compile time
Description
Allow user to set default path as an environment variable. If the path is invalid, we still set it to path.join(os.homedir(), 'Documents', 'Composer').
Did a merge operation on data.json and data.template.json if it already exists.
Task Item
Closes #1610
Closes #1363
Type of change
Please delete options that are not relevant.
Checklist
Screenshots
Please include screenshots or gifs if your PR include UX changes.