1 | ;
|
2 | /*
|
3 | * @adonisjs/sink
|
4 | *
|
5 | * (c) Harminder Virk <virk@adonisjs.com>
|
6 | *
|
7 | * For the full copyright and license information, please view the LICENSE
|
8 | * file that was distributed with this source code.
|
9 | */
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | exports.YamlFile = void 0;
|
12 | const mrm_core_1 = require("mrm-core");
|
13 | const KeyValuePair_1 = require("../Base/KeyValuePair");
|
14 | /**
|
15 | * Exposes the API to work with Yaml files.
|
16 | *
|
17 | * ```ts
|
18 | * const yaml = new YamlFile(__dirname, '.travis.yml')
|
19 | * yaml.set('language', 'node_js')
|
20 | * yaml.set('language', [4, 6])
|
21 | *
|
22 | * yaml.commit()
|
23 | * ```
|
24 | */
|
25 | class YamlFile extends KeyValuePair_1.KeyValuePair {
|
26 | constructor(basePath, filename) {
|
27 | super(basePath);
|
28 | this.cdIn();
|
29 | this.filePointer = (0, mrm_core_1.yaml)(filename);
|
30 | this.cdOut();
|
31 | }
|
32 | }
|
33 | exports.YamlFile = YamlFile;
|