Subject | Hash | Author | Date (UTC) |
---|---|---|---|
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 |
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 |
test this | 27b7953902d0e3d7a6c3ed73c911690a5e814954 | mucbuc | 2020-07-04 18:09:59 |
moreshit | 592c64abc5f14a08c094be44f7d19ae6264e36b8 | mucbuc | 2020-07-04 18:08:56 |
fix merge conflict | ab4ee2b9ebbaa6379bdb83664efae5d45c428e5d | mucbuc | 2020-07-04 18:01:40 |
cleanup | e363a09bd4cf01d773d3725db73f3465c89bb4e7 | mucbuc | 2020-07-04 17:58:30 |
File | Lines added | Lines deleted |
---|---|---|
install.js | 11 | 3 |
File install.js changed (mode: 100755) (index 49232e5..a4dd558) | |||
... | ... | const fs = require("fs"), | |
8 | 8 | { COPYFILE_EXCL } = fs.constants; | { COPYFILE_EXCL } = fs.constants; |
9 | 9 | ||
10 | 10 | sourceOnSession(scriptName); | sourceOnSession(scriptName); |
11 | installFile( 'editorconfig' ); | ||
11 | const files = ["gitconfig", "vimrc", "editorconfig"]; | ||
12 | for (let file of files) { | ||
13 | installFile( file ); | ||
14 | } | ||
12 | 15 | ||
13 | 16 | function installFile(fileName) { | function installFile(fileName) { |
14 | 17 | const src = path.join(__dirname, fileName), | const src = path.join(__dirname, fileName), |
15 | 18 | dst = path.join(homedir, `.${fileName}`); | dst = path.join(homedir, `.${fileName}`); |
16 | fs.symlink(dst, src, (err) => { | ||
19 | |||
20 | fs.symlink(src, dst, (err) => { | ||
17 | 21 | if (err) { | if (err) { |
18 | 22 | if (err.code == 'EEXIST') { | if (err.code == 'EEXIST') { |
19 | 23 | console.log( `${fileName} already installed` ); | console.log( `${fileName} already installed` ); |
... | ... | function installFile(fileName) { | |
22 | 26 | throw err; | throw err; |
23 | 27 | } | } |
24 | 28 | } | } |
29 | else | ||
30 | { | ||
31 | console.log(`installing ${fileName}`); | ||
32 | } | ||
25 | 33 | }); | }); |
26 | 34 | } | } |
27 | 35 | ||
... | ... | function sourceOnSession(scriptName) { | |
29 | 37 | const scriptPath = path.join(__dirname, scriptName); | const scriptPath = path.join(__dirname, scriptName); |
30 | 38 | let bashRC = fs.readFileSync(bashPath, "utf8"); | let bashRC = fs.readFileSync(bashPath, "utf8"); |
31 | 39 | if (!bashRC.match(scriptName)) { | if (!bashRC.match(scriptName)) { |
32 | console.log(`installing ${scriptPath}`); | ||
40 | console.log(`installing ${scriptName}`); | ||
33 | 41 | bashRC += `\n. ${scriptPath}`; | bashRC += `\n. ${scriptPath}`; |
34 | 42 | fs.writeFileSync(bashPath, bashRC); | fs.writeFileSync(bashPath, bashRC); |
35 | 43 | } else { | } else { |