Skip to content

Commit 1644e2e

Browse files
committed
Updated code on reviews and feedback
1 parent 7fc0a96 commit 1644e2e

File tree

13 files changed

+492
-509
lines changed

13 files changed

+492
-509
lines changed

IDE_SETUP_COMMANDS.md

Lines changed: 0 additions & 300 deletions
This file was deleted.

artifactory/cli/cli.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
"strings"
77

88
ioutils "github.com/jfrog/gofrog/io"
9-
"github.com/jfrog/jfrog-cli-artifactory/artifactory/cli/ide/jetbrains"
10-
"github.com/jfrog/jfrog-cli-artifactory/artifactory/cli/ide/vscode"
119
"github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/buildinfo"
1210
"github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/container"
1311
"github.com/jfrog/jfrog-cli-artifactory/artifactory/commands/curl"
@@ -406,10 +404,6 @@ func GetCommands() []components.Command {
406404
Category: replicCategory,
407405
},
408406
}
409-
// Add all VSCode commands
410-
commands = append(commands, vscode.GetCommands()...)
411-
// Add all JetBrains commands
412-
commands = append(commands, jetbrains.GetCommands()...)
413407

414408
return commands
415409
}

artifactory/cli/ide/common.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package ide
2+
3+
import (
4+
"fmt"
5+
6+
pluginsCommon "github.com/jfrog/jfrog-cli-core/v2/plugins/common"
7+
"github.com/jfrog/jfrog-cli-core/v2/plugins/components"
8+
)
9+
10+
// ValidateSingleNonEmptyArg checks that there is exactly one argument and it is not empty.
11+
func ValidateSingleNonEmptyArg(c *components.Context, usage string) (string, error) {
12+
if c.GetNumberOfArgs() != 1 {
13+
return "", pluginsCommon.WrongNumberOfArgumentsHandler(c)
14+
}
15+
arg := c.GetArgumentAt(0)
16+
if arg == "" {
17+
return "", fmt.Errorf("argument cannot be empty\n\nUsage: %s", usage)
18+
}
19+
return arg, nil
20+
}
21+
22+
// HasServerConfigFlags checks if any server configuration flags are provided
23+
func HasServerConfigFlags(c *components.Context) bool {
24+
return c.IsFlagSet("url") ||
25+
c.IsFlagSet("user") ||
26+
c.IsFlagSet("access-token") ||
27+
c.IsFlagSet("server-id") ||
28+
// Only consider password if other required fields are also provided
29+
(c.IsFlagSet("password") && (c.IsFlagSet("url") || c.IsFlagSet("server-id")))
30+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package ide
2+
3+
const VscodeConfigDescription = `
4+
Configure VSCode to use JFrog Artifactory for extensions.
5+
6+
The service URL should be in the format:
7+
https://<artifactory-url>/artifactory/api/vscodeextensions/<repo-key>/_apis/public/gallery
8+
9+
Examples:
10+
jf vscode-config https://mycompany.jfrog.io/artifactory/api/vscodeextensions/vscode-extensions/_apis/public/gallery
11+
12+
This command will:
13+
- Modify the VSCode product.json file to change the extensions gallery URL
14+
- Create an automatic backup before making changes
15+
- Require VSCode to be restarted to apply changes
16+
17+
Optional: Provide server configuration flags (--url, --user, --password, --access-token, or --server-id)
18+
to enable repository validation. Without these flags, the command will only modify the local VSCode configuration.
19+
20+
Note: On macOS/Linux, you may need to run with sudo for system-installed VSCode.
21+
`
22+
23+
const JetbrainsConfigDescription = `
24+
Configure JetBrains IDEs to use JFrog Artifactory for plugins.
25+
26+
The repository URL should be in the format:
27+
https://<artifactory-url>/artifactory/api/jetbrainsplugins/<repo-key>
28+
29+
Examples:
30+
jf jetbrains-config https://mycompany.jfrog.io/artifactory/api/jetbrainsplugins/jetbrains-plugins
31+
32+
This command will:
33+
- Detect all installed JetBrains IDEs
34+
- Modify each IDE's idea.properties file to add the plugins repository URL
35+
- Create automatic backups before making changes
36+
- Require IDEs to be restarted to apply changes
37+
38+
Optional: Provide server configuration flags (--url, --user, --password, --access-token, or --server-id)
39+
to enable repository validation. Without these flags, the command will only modify the local IDE configuration.
40+
41+
Supported IDEs: IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, RubyMine, CLion, DataGrip, GoLand, Rider, Android Studio, AppCode, RustRover, Aqua
42+
`

0 commit comments

Comments
 (0)