util

package
Version: v2.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayContains

func ArrayContains(arr []string, str string) bool

ArrayContains checks if a string array contains a value

func CleanDataDirectory

func CleanDataDirectory(dir string) error

CleanDataDirectory removes directory

func CreateDataDir

func CreateDataDir(dir string) error

CreateDataDir creates a data dir with proper permissions for ardi / arduino-cli

func GenArdiConfig

func GenArdiConfig() *types.ArdiConfig

GenArdiConfig returns default ardi.json in current directory

func GenArduinoCliSettings

func GenArduinoCliSettings(dataDir string) *types.ArduinoCliSettings

GenArduinoCliSettings generated data config file with default values

func GeneratePropsArray

func GeneratePropsArray(props map[string]string) []string

GeneratePropsArray returns an arrary of props from props map

func GeneratePropsMap

func GeneratePropsMap(buildProps []string) map[string]string

GeneratePropsMap returns map of build props from string array

func GetAllSettings

func GetAllSettings() (*types.ArdiConfig, *types.ArduinoCliSettings)

GetAllSettings returns settings for both ardi and arduino-cli

func GetCliSettingsPath added in v2.1.0

func GetCliSettingsPath() string

GetCliSettingsPath returns path to arduino-cli.yaml based on scope

func InitProjectDirectory

func InitProjectDirectory() error

InitProjectDirectory initializes a directory as an ardi project

func IsProjectDirectory

func IsProjectDirectory() bool

IsProjectDirectory returns whether or not currect directory has been initialized as an ardi project

func ParseSketchBaud

func ParseSketchBaud(sketch string) int

ParseSketchBaud reads a sketch file and tries to parse baud rate

func ProcessSketch

func ProcessSketch(filePath string) (*types.Project, error)

ProcessSketch looks for .ino file in specified directory and parses

func ReadArdiConfig

func ReadArdiConfig(confPath string) (*types.ArdiConfig, error)

ReadArdiConfig reads ardi.json and returns config

func ReadArduinoCliSettings

func ReadArduinoCliSettings(confPath string) (*types.ArduinoCliSettings, error)

ReadArduinoCliSettings reads data config file and returns unmarshalled data and stringified version

func WriteAllSettings

func WriteAllSettings(ardiConfig *types.ArdiConfig, arduinoSettings *types.ArduinoCliSettings) error

WriteAllSettings writes all settings files

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL