Add file upload on gist creation/edition (#507)

هذا الالتزام موجود في:
Thomas Miceli
2025-09-16 01:56:38 +02:00
ملتزم من قبل GitHub
الأصل 594d876ba8
التزام 53ce41e0e4
12 ملفات معدلة مع 478 إضافات و77 حذوفات

عرض الملف

@@ -380,6 +380,17 @@ func SetFileContent(gistTmpId string, filename string, content string) error {
return os.WriteFile(filepath.Join(repositoryPath, filename), []byte(content), 0644)
}
func MoveFileToRepository(gistTmpId string, filename string, sourcePath string) error {
repositoryPath := TmpRepositoryPath(gistTmpId)
destPath := filepath.Join(repositoryPath, filename)
if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil {
return err
}
return os.Rename(sourcePath, destPath)
}
func AddAll(gistTmpId string) error {
tmpPath := TmpRepositoryPath(gistTmpId)