change name folder, project file optimization

This commit is contained in:
Данил 2023-03-18 16:50:33 +03:00
parent de77b44647
commit 0fa390c8ee
No known key found for this signature in database
GPG key ID: 5051BCD5AB064A7B

View file

@ -5,27 +5,26 @@ import (
"os/user" "os/user"
"strings" "strings"
"github.com/Redume/EveryNasa/api/utils" "github.com/Redume/EveryNasa/utils"
"github.com/Redume/EveryNasa/functions"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
) )
var CreateLabel = func(c *fiber.Ctx) error { var CreateLabel = func(c *fiber.Ctx) error {
u, err := user.Current() u, err := user.Current()
if err != nil { if err != nil {
functions.Logger(err.Error()) utils.Logger(err.Error())
} }
dir, err := os.Getwd() dir, err := os.Getwd()
if err != nil { if err != nil {
functions.Logger(err.Error()) utils.Logger(err.Error())
} }
dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\EveryNasa.exe" dir = strings.Replace(dir, "\\", "\\\\", -1) + "\\EveryNasa.exe"
err = functions.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\Desktop\\EveryNasa.lnk") err = utils.CreateLnk(dir, strings.Replace(u.HomeDir, "\\", "\\\\", -1)+"\\Desktop\\EveryNasa.lnk")
if err != nil { if err != nil {
functions.Logger(err.Error()) utils.Logger(err.Error())
} }
utils.Respond(c, utils.Message(true, "The shortcut was successfully created")) utils.Respond(c, utils.Message(true, "The shortcut was successfully created"))