dev
List of commits:
Subject Hash Author Date (UTC)
move utils into base 4215714e30c44cd28b99a47b9809c379b5a6f5b1 mucbuc 2020-07-25 11:14:02
single branch 4e7951ffa4679e6aede7e41e9bb8afcc256cfdbe mucbuc 2020-07-25 04:11:11
install minpac ea2855da3c825616fbf41621caabe93ff6952651 mucbuc 2020-07-25 04:04:25
fix symlink direction 58c6f88e75de4b660aa5d1635d6ed30722531c10 mucbuc 2020-07-24 14:55:46
working on symlinking dot files 4776a043a739cb668621575853090fd3169d49b1 mucbuc 2020-07-24 14:44:31
source on session 440a64a0f75de56580b1b50c297b53dd2273781f mucbuc 2020-07-24 14:17:32
cleanup 18562b90e1ae6e111748c5ee9aa556f832bc4297 mucbuc 2020-07-19 14:54:23
README.md de769b63ff8f23a593dc1f16ac2838973bdef13a Ubuntu 2020-07-13 21:07:27
format 11b3b5dda7f9897eac97a3a07d48404c72f8c945 mucbuc 2020-07-08 04:01:06
pre-commit not linting a6150b39d873c4796ea7f0eb02f116f7c5068124 mucbuc 2020-07-08 03:42:52
stagedFiles 09505713d1e6eb5da489a5081fe904794110b8a0 mucbuc 2020-07-08 03:40:49
lint 36aa6510d88da2d7cdde5fb776a33ef6d20f5242 mucbuc 2020-07-08 03:28:02
copy scripts 2010244fc51915c8700b370a04aa9ea1af6de30d mucbuc 2020-07-07 09:23:09
dont add changes from lint b0a615143517985a99f929b1f313751cc9369bb6 mucbuc 2020-07-05 04:43:28
pre-commit.js a4ab48e75e496071f24a910524f8ec788c0f5309 mucbuc 2020-07-05 04:28:05
install husky 97104fc9ba4dd4164bf29eaf7505f10d61ace7d7 mucbuc 2020-07-05 04:21:51
print commands 054c9efa2ae06a16f05a080b111cb3b1b27f3287 mucbuc 2020-07-05 04:17:28
use green instead of yellow ce503ff8ef3dba2761179ccb56e629542b3e27cd mucbuc 2020-07-04 20:31:01
color output 3d198cf7d4e657ab8ba8d798174116b8336ef258 mucbuc 2020-07-04 20:17:24
explict mode ffc586960df26c70adba18de1ed30616e3057edf mucbuc 2020-07-04 18:11:36
Commit 4215714e30c44cd28b99a47b9809c379b5a6f5b1 - move utils into base
Author: mucbuc
Author date (UTC): 2020-07-25 11:14
Committer name: mucbuc
Committer date (UTC): 2020-07-25 11:14
Parent(s): 74ac404fa3c1316fc2cbedea9fc92cbd096f9fc1
Signer:
Signing key:
Signing status: N
Tree: 2f5c76905d7e9ae4ddfa47880e76aeef856f9992
File Lines added Lines deleted
base.js 42 1
install.js 3 55
File base.js changed (mode: 100644) (index 07d795c..c56cf3b)
1 1 const shell = require("shelljs"), const shell = require("shelljs"),
2 2 fs = require("fs"), fs = require("fs"),
3 path = require("path"),
3 4 ansi = require("ansi"), ansi = require("ansi"),
4 cursor = ansi(process.stdout);
5 cursor = ansi(process.stdout),
6 homedir = require("os").homedir(),
7 bashPath = path.join(homedir, ".bashrc"),
8 exec = shell.exec,
9 { COPYFILE_EXCL } = fs.constants;
10
11 function cloneRepo(url, dest) {
12 exec(`git clone ${url} --depth=1 --single-branch ${dest}`);
13 }
14
15 function installFile(fileName) {
16 const src = path.join(__dirname, fileName),
17 dst = path.join(homedir, `.${fileName}`);
18
19 fs.symlink(src, dst, (err) => {
20 if (err) {
21 if (err.code == "EEXIST") {
22 console.log(`${fileName} already installed`);
23 } else {
24 throw err;
25 }
26 } else {
27 console.log(`installing ${fileName}`);
28 }
29 });
30 }
31
32 function sourceOnSession(scriptName) {
33 const scriptPath = path.join(__dirname, scriptName);
34 let bashRC = fs.readFileSync(bashPath, "utf8");
35 if (!bashRC.match(scriptName)) {
36 console.log(`installing ${scriptName}`);
37 bashRC += `\n. ${scriptPath}`;
38 fs.writeFileSync(bashPath, bashRC);
39 } else {
40 console.log(`${scriptName} already installed`);
41 }
42 }
5 43
6 44 module.exports = { module.exports = {
45 sourceOnSession,
46 installFile,
47 cloneRepo,
7 48 exec: shell.exec, exec: shell.exec,
8 49 tryAndRunScript: function (name) { tryAndRunScript: function (name) {
9 50 try { try {
File install.js changed (mode: 100755) (index f6a8ff3..5052bd7)
1 1 #!/usr/bin/env node #!/usr/bin/env node
2 2
3 const fs = require("fs"),
4 homedir = require("os").homedir(),
5 path = require("path"),
6 bashPath = path.join(homedir, ".bashrc"),
7 scriptName = "marks_bashrc",
8 exec = require("shelljs").exec,
9 { COPYFILE_EXCL } = fs.constants;
3 const { exec, sourceOnSession, installFile, cloneRepo } = require( './base' );
10 4
11 5 exec("git status"); exec("git status");
12 sourceOnSession(scriptName);
6 sourceOnSession("marks_bashrc");
13 7 const files = ["gitconfig", "vimrc", "editorconfig"]; const files = ["gitconfig", "vimrc", "editorconfig"];
14 8 for (let file of files) { for (let file of files) {
15 9 installFile(file); installFile(file);
16 10 } }
17 11
18 clone("https://github.com/k-takata/minpac", "~/.vim/pack/minpac/opt/minpac");
12 cloneRepo("https://github.com/k-takata/minpac", "~/.vim/pack/minpac/opt/minpac");
19 13
20 function clone(url, dest) {
21 exec(`git clone ${url} --depth=1 --single-branch ${dest}`);
22 }
23
24 function installFile(fileName) {
25 const src = path.join(__dirname, fileName),
26 dst = path.join(homedir, `.${fileName}`);
27
28 fs.symlink(src, dst, (err) => {
29 if (err) {
30 if (err.code == "EEXIST") {
31 console.log(`${fileName} already installed`);
32 } else {
33 throw err;
34 }
35 } else {
36 console.log(`installing ${fileName}`);
37 }
38 });
39 }
40
41 function sourceOnSession(scriptName) {
42 const scriptPath = path.join(__dirname, scriptName);
43 let bashRC = fs.readFileSync(bashPath, "utf8");
44 if (!bashRC.match(scriptName)) {
45 console.log(`installing ${scriptName}`);
46 bashRC += `\n. ${scriptPath}`;
47 fs.writeFileSync(bashPath, bashRC);
48 } else {
49 console.log(`${scriptName} already installed`);
50 }
51 }
52
53 ////copyDotFiles();
54
55 function copyDotFiles() {
56 const files = ["gitconfig", "vimrc", "editorconig"];
57 for (let file of files) {
58 const src = path.join(__dirname, file),
59 dst = path.join(homedir, `.${file}`);
60 fs.copyFile(src, dst, COPYFILE_EXCL, (err) => {
61 if (err) console.log(`${src} already installed`);
62 else console.log(` ${src} -> ${dst}`);
63 });
64 }
65 }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mucbuc/configs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mucbuc/configs

Clone this repository using git:
git clone git://git.rocketgit.com/user/mucbuc/configs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main