I have created a snap of my application using
The application at its core first shows two prompt asking user to enter name and age. The user input data is then saved into
config.toml file in the root directory. Next, the application will print out the user entered data.
The current behavior of the snap is it asks the user to enter the data and prints the data that was previously entered. This means the data entered now will be printed when the application will run next time.
I got the idea of using
SNAP_USER_DATA to save the user config but I’m not sure about that how can I effectively use it.
I wanted to persist data of config file to SNAP_USER_DATA.
To break down the question, I wanted to perform the following steps:
- create a config file inside SNAP_USER_DATA. From the stack overflow, I can do this by:
$ mkdir -p snap/hooks $ echo "touch \$SNAP_USER_DATA/config.toml" >> snap/hooks/install $ chmod a+x snap/hooks/install
is that possible to specify this is
.yaml file? so that when I create the snap this file should also be created at run time.
next either I directly want to save the user input into
$SNAP_USER_DATA/config.tomlor copy from
finally, I want to use config from
$SNAP_USER_DATA/config.tomlinside my app.
here is the link of my app: https://github.com/m-yahya/snap-tutorial
any help will be much appreciated.