basefile.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 2025 BackendServerTemplate Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package basefile
  5. import "github.com/SongZihuan/BackendServerTemplate/tool/utils/fileutils"
  6. const (
  7. FileVersion = "./VERSION"
  8. FileLicense = "./LICENSE"
  9. FileReport = "./REPORT"
  10. FileName = "./NAME"
  11. FileEnvPrefix = "./ENV_PREFIX"
  12. FileBuildDateTxt = "./build_date.txt"
  13. FileCommitDateTxt = "./commit_data.txt"
  14. FileTagDataTxt = "./tag_data.txt"
  15. FileTagCommitData = "./tag_commit_data.txt"
  16. FileRandomData = "./random_data.txt"
  17. FileReleaseInfoMD = "./release_info.md"
  18. )
  19. func CreateBaseFile() (err error) {
  20. err = fileutils.Touch(FileVersion)
  21. if err != nil {
  22. return err
  23. }
  24. err = fileutils.Touch(FileLicense)
  25. if err != nil {
  26. return err
  27. }
  28. err = fileutils.Touch(FileReport)
  29. if err != nil {
  30. return err
  31. }
  32. err = fileutils.Touch(FileName)
  33. if err != nil {
  34. return err
  35. }
  36. err = fileutils.Touch(FileEnvPrefix)
  37. if err != nil {
  38. return err
  39. }
  40. err = fileutils.Touch(FileBuildDateTxt)
  41. if err != nil {
  42. return err
  43. }
  44. err = fileutils.Touch(FileCommitDateTxt)
  45. if err != nil {
  46. return err
  47. }
  48. err = fileutils.Touch(FileTagDataTxt)
  49. if err != nil {
  50. return err
  51. }
  52. err = fileutils.Touch(FileTagCommitData)
  53. if err != nil {
  54. return err
  55. }
  56. err = fileutils.Touch(FileRandomData)
  57. if err != nil {
  58. return err
  59. }
  60. err = fileutils.Touch(FileReleaseInfoMD)
  61. if err != nil {
  62. return err
  63. }
  64. return nil
  65. }