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

how does it actually works ? #9

Closed
ctf0 opened this issue Nov 15, 2022 · 5 comments
Closed

how does it actually works ? #9

ctf0 opened this issue Nov 15, 2022 · 5 comments

Comments

@ctf0
Copy link

ctf0 commented Nov 15, 2022

i've followed the example of https://github.com/egomobile/vscode-powertools/wiki/Buttons but nothing works

Version: 1.74.0-insider
Commit: 3fb8e8feb1c93a490feb2c2259713d4c8f0e0058
Date: 2022-11-14T10:15:39.203Z
Electron: 19.1.3
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
@ctf0 ctf0 changed the title how does this actually works ? how does it actually works ? Nov 15, 2022
@mkloubert
Copy link
Collaborator

@ctf0 for me the first example works fine

can you give a detailed and exact example, what you did from your side?

@ctf0
Copy link
Author

ctf0 commented Nov 15, 2022

  1. i created an exact copy of the example
  2. the btn was added to the status bar
  3. clicking the btn doesnt fire the information msg
  • i tried adding the config in both the global settings & workspace settings, nothing changed
  • i tried haveing the script path as an absolute path outside the workspace & having it next to the workspace settings file as the example but nothing changed

maybe it have to do with the insiders version am using, am not sure, if there is a way to debug this, plz tell me.

@mkloubert
Copy link
Collaborator

@ctf0

how does your settings look like and where is the JS file stored?

@ctf0
Copy link
Author

ctf0 commented Nov 17, 2022

  • global user settings
"ego.power-tools": {
        "startup": [
            // doesnt work
            {
                "script": "startup.js"
            },
            // show information msg, but cmnd give error 
            // Running shell command 'npm install' ... [FAILED: '[Error] 'Command failed: npm install
            {
                "command": "npm install",
                "if": " !$fs.existsSync( $v['workspaceRoot'] + '/node_modules' ) "
            }
        ]
    },
  • startup.js ~/.vscode-powertools/startup.js
exports.execute = async (args) => {
    const vscode = args.require('vscode');

    await refreshProjects(vscode)
};

async function refreshProjects(vscode)
{
    await vscode.commands.executeCommand('projectManager.refreshProjects')

    vscode.window.showInformationMessage(
        'Project Manager: Refresh Projects'
    );
}

@ctf0
Copy link
Author

ctf0 commented Nov 17, 2022

also keep getting this in the output

Initializing extension ...

[xxx] Initializing workspace ...
Running shell command '' ... [FAILED: '[TypeError] 'The argument 'file' cannot be empty. Received '''']
[xxx] 🧾 startups.onstartup(1) :: The argument 'file' cannot be empty. Received ''
[xxx] Executed all startups.
[xxx] Workspace initialized.

Extension has been initialized.

Your network configuration:
================================
Hostname: xxx.local

Network interfaces:
    - ....

with settings of

"ego.power-tools": {
        "startup": [
            {
                "script": "startup.js"
            }
        ]
    },

@ctf0 ctf0 closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants