Commit e0dc17e9 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

fix(meepctl): ensure ~/.meep directories are created with correct uid/gid ownership

parent 0d3795c7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -178,6 +178,17 @@ func deployEnsureStorage(cobraCmd *cobra.Command) {
		err = errors.New("Error creating path [" + deployData.workdir + "]")
		fmt.Println(err)
	}

	// Set ownership of the workdir to the configured uid and gid
	uid := utils.RepoCfg.GetString("repo.deployment.permissions.uid")
	gid := utils.RepoCfg.GetString("repo.deployment.permissions.gid")
	if uid != "" && gid != "" {
		chownCmd := exec.Command("chown", "-R", uid+":"+gid, deployData.workdir)
		_, err = utils.ExecuteCmd(chownCmd, cobraCmd)
		if err != nil {
			fmt.Println("Warning: Error setting ownership for path [" + deployData.workdir + "]. You may need to run this command with elevated privileges (e.g., sudo).")
		}
	}
}

// Deploy core