66 "path/filepath"
77 "strings"
88
9- "github.com/gookit/color"
109 artifactoryCommandsUtils "github.com/jfrog/jfrog-cli-core/v2/artifactory/commands/utils"
1110 artifactoryUtils "github.com/jfrog/jfrog-cli-core/v2/artifactory/utils"
1211 "github.com/jfrog/jfrog-cli-core/v2/utils/config"
@@ -71,20 +70,26 @@ func (pic *ProjectInitCommand) Run() (err error) {
7170 }
7271
7372 message :=
74- bold ("You're all set!" ) +
73+ coreutils .PrintBold ("This project is initialized!\n " ) +
74+ coreutils .PrintBold ("The project config is stored inside the .jfrog directory." ) +
7575 "\n \n " +
76- bold ("The project config is stored inside the .jfrog directory." ) +
77- "\n \n " +
78- title ("Audit your code project for security vulnerabilities by running" ) +
76+ coreutils .PrintTitle ("Audit your code project for security vulnerabilities by running" ) +
7977 "\n " +
8078 "jf audit\n \n " +
81- title ("Scan any software package on this machine for security vulnerabilities by running" ) +
79+ coreutils .PrintTitle ("or if you're using VS Code, IntelliJ IDEA, WebStorm, PyCharm, Android Studio or GoLand" ) +
80+ "\n " +
81+ "Open the IDE\n " +
82+ "Install the JFrog extension or plugin\n " +
83+ "View the JFrog panel\n " +
84+ "\n " +
85+ coreutils .PrintTitle ("Scan any software package on this machine for security vulnerabilities by running" ) +
8286 "\n " +
8387 "jf scan path/to/dir/or/package\n \n " +
88+
8489 pic .createBuildMessage (technologiesMap ) +
85- title ("Read more using this link:" ) +
90+ coreutils . PrintTitle ("Read more using this link:" ) +
8691 "\n " +
87- link (coreutils .GettingStartedGuideUrl )
92+ coreutils . PrintLink (coreutils .GettingStartedGuideUrl )
8893 fmt .Println ()
8994 err = coreutils .PrintTable ("" , "" , message )
9095 fmt .Println ()
@@ -111,51 +116,24 @@ func (pic *ProjectInitCommand) createBuildMessage(technologiesMap map[coreutils.
111116 case coreutils .Pypi :
112117 message +=
113118 "jf pip install\n " +
114- "jf rt u path/to/package/file default-pypi-local" + comment (" # Publish your pip package" ) +
119+ "jf rt u path/to/package/file default-pypi-local" +
120+ coreutils .PrintComment (" # Publish your pip package" ) +
115121 "\n "
116122 }
117123 }
118124 }
119125 if message != "" {
120- message = title ("Build the code & deploy the packages by running" ) +
126+ message = coreutils . PrintTitle ("Build the code & deploy the packages by running" ) +
121127 "\n " +
122128 message +
123129 "\n " +
124- title ("Publish the build-info to Artifactory" ) +
130+ coreutils . PrintTitle ("Publish the build-info to Artifactory" ) +
125131 "\n " +
126132 "jf rt bp\n \n "
127133 }
128134 return message
129135}
130136
131- // Print the test to the console in green color.
132- func title (str string ) string {
133- return colorStr (str , color .Green )
134- }
135-
136- // Print the test to the console in cyan color.
137- func link (str string ) string {
138- return colorStr (str , color .Cyan )
139- }
140-
141- // Print the test to the console with bold style.
142- func bold (str string ) string {
143- return colorStr (str , color .Bold )
144- }
145-
146- // Print the test to the console in gray color.
147- func comment (str string ) string {
148- return colorStr (str , color .Gray )
149- }
150-
151- // Print the test to the console with the specified color.
152- func colorStr (str string , c color.Color ) string {
153- if coreutils .IsTerminal () {
154- return c .Render (str )
155- }
156- return str
157- }
158-
159137type BuildConfigFile struct {
160138 Version int `yaml:"version,omitempty"`
161139 ConfigType string `yaml:"type,omitempty"`
0 commit comments