Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArchiveLocalFiles ¶
func ArchiveLocalFiles(archiveRoot string, files []ProjectFile) error
ArchiveLocalFiles writes local files to the given archive root.
func BuildContent ¶
func BuildContent(files []ProjectFile) *script.Content
BuildContent converts local files to a Script API content payload.
func DefaultFileExtensions ¶
DefaultFileExtensions returns the default Apps Script file extensions.
func SortFilesByPushOrder ¶
func SortFilesByPushOrder(files []ProjectFile, filePushOrder []string, rootDir string)
SortFilesByPushOrder sorts files using filePushOrder rules.
Types ¶
type Options ¶
type Options struct {
ProjectRoot string
RootDir string
Ignore *config.ClaspIgnore
FileExtensions map[string][]string
FilePushOrder []string
SkipSubdirectories bool
}
Options defines settings for local/remote synchronization.
func OptionsFromConfig ¶
func OptionsFromConfig(projectRoot string, cfg *config.ClaspConfig, ignore *config.ClaspIgnore) (Options, error)
OptionsFromConfig builds Options from a .clasp.json config.
type ProjectFile ¶
type ProjectFile struct {
// LocalPath is the project-relative path on disk (e.g. "src/Code.gs").
LocalPath string
// RemotePath is the Apps Script file name/path without extension (e.g. "Code" or "ui/page").
RemotePath string
// Type maps to Apps Script file types (SERVER_JS, HTML, JSON).
Type string
// Source is the file contents to send to or received from the Script API.
Source string
}
ProjectFile represents a file mapped between local and remote.
func ApplyRemoteContent ¶
func ApplyRemoteContent(opts Options, content *script.Content) ([]ProjectFile, error)
ApplyRemoteContent writes remote content to the local filesystem.
func CollectLocalFiles ¶
func CollectLocalFiles(opts Options) ([]ProjectFile, error)
CollectLocalFiles scans local files and returns push-ready project files.
Click to show internal directories.
Click to hide internal directories.