You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2022/09/17 04:20:11 UTC

[skywalking-eyes] branch dep/output created (now 442f7c9)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch dep/output
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git


      at 442f7c9  dep: do not write license files if they already exist

This branch includes the following new commits:

     new 442f7c9  dep: do not write license files if they already exist

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-eyes] 01/01: dep: do not write license files if they already exist

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch dep/output
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git

commit 442f7c9070b47649175e46c28000d2b707f7c206
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sat Sep 17 12:20:04 2022 +0800

    dep: do not write license files if they already exist
---
 commands/deps_resolve.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/commands/deps_resolve.go b/commands/deps_resolve.go
index cc4d00c..3ff2df1 100644
--- a/commands/deps_resolve.go
+++ b/commands/deps_resolve.go
@@ -114,6 +114,10 @@ var DepsResolveCommand = &cobra.Command{
 func writeLicense(result *deps.Result) {
 	filename := string(fileNamePattern.ReplaceAll([]byte(result.Dependency), []byte("-")))
 	filename = filepath.Join(outDir, "license-"+filename+".txt")
+	if _, err := os.Stat(filename); err == nil {
+		logger.Log.Debug("File already exists, skipping: %s", filename)
+		return
+	}
 	file, err := os.Create(filename)
 	if err != nil {
 		logger.Log.Errorf("failed to create license file %v: %v", filename, err)