Skip to content
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

PowerApps Cli creating a usersettings.json in the wrong path #207

Open
jansonjc opened this issue May 19, 2022 · 5 comments
Open

PowerApps Cli creating a usersettings.json in the wrong path #207

jansonjc opened this issue May 19, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@jansonjc
Copy link

Describe the bug

The PowerApp Cli seems to be creating the usersetting.json in a wrong path. Instead of creating in user's Library folder, it seems to be creating in the application folder. This is happening in MacOS. The attached screenshot will help explain this better.

Version: 1.15.3+g79950a8

To Reproduce

  • Install Power Platform Tools for Visual Studio Code (Mac M1)
  • Execute any Cli commands
  • A new folder structure gets created inside the application folder instead of ~/Library

Screenshots

PowerApps-Cli-Folder-Issue

@landonmsft landonmsft added the bug Something isn't working label Jun 1, 2022
@davidjenni
Copy link
Member

davidjenni commented Jun 9, 2022

@jansonjc oh, that's a bizarre bug, thanks for reporting it!
I assume you're installing the pac CLI on your mac via the PP VSCode extension, right?

I wasn't able to repro it on my MBP when only using pac CLI (e.g. pac telemetry disable, then ... enable would force writing the usersettings file). But I can repro when building a PCF proj with our pcf-scripts npm package:

pac pcf init -ns dj  -n ctrl1 -t field -fw react -o ctrl1
cd ctrl1
npm i
npm run build

alas, there's now a usersettings file...

[14:59:47] ~/s/p/ctrl1 
davidjen@davidjen-mbp $ find . -name usersettings.json
./~/Library/Microsoft/PowerAppsCli/usersettings.json

I'm transferring this issue to our powerplatform-vscode issues tracker; internal bug we have for tracking: AB#2750719

CC: @landonarogers @tehcrashxor @swapnilbhalgat

@davidjenni davidjenni transferred this issue from microsoft/PowerApps-Tooling Jun 9, 2022
@jansonjc
Copy link
Author

@davidjenni that's right. This happens when the pac CLI commands are run within the integrated terminal of vscode. I have a shell script that contains a number of CLI commands (select environment, solution export, unpack, import, etc...) It is quite possible that one of these commands is causing this issue. Since you are able to reproduce this with pcf command, I hope the powerplatform-vscode team will be able to address it. Let me know if you want me to try and figure out exactly which command(s) is causing this.

@cathalnoonan
Copy link

cathalnoonan commented Aug 17, 2022

I'm having the issue as well (macOS).

It seems like the tilde character returned form getAppDataPath() isn't resolving to the home directory as expected.

@mccheesy
Copy link

mccheesy commented Jan 19, 2024

Any updates on this issue? Can confirm that if I change src/client/telemetry/appdata.ts:13 to

return `${process.env.HOME}/Library/`

I don't get an extra directory structure in the local directory when running PAC commands from VS Code. Not sure why #cathalnoonan marked out their assertion about the getAppDataPath() method as that does seem to be the culprit.

@cathalnoonan
Copy link

I've forgotten the exact reason for crossing that out.

I think the folder was still created when using the pac cli directly (without the vscode extension).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants