-const { readFile, writeFile } = require('fs/promises');
-const { rmIfExists } = require('./utils');
+import { readFile, writeFile } from 'fs/promises';
+import { rmIfExists } from './utils.js';
+
+import GitStrategy from './remotes/git.js';
const internals = {
strings: {
configurationNotFound: 'Remote configuration not set, consult help for more info.'
},
strategies: [
- require('./remotes/git')
+ GitStrategy
]
};
-module.exports = {
+export default {
async add(remoteConfig, remote) {
await writeFile(remoteConfig, remote);
throw new Error(internals.strings.configurationNotFound);
}
}
-}
+};