mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
cleanup
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const home = require('os').homedir();
|
||||
|
||||
module.exports = str => {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof str}`);
|
||||
}
|
||||
|
||||
return home ? str.replace(/^~(?=$|\/|\\)/, home) : str;
|
||||
};
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "untildify",
|
||||
"version": "3.0.3",
|
||||
"description": "Convert a tilde path to an absolute path: ~/dev => /Users/sindresorhus/dev",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/untildify",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"contributors": [
|
||||
"silverwind <me@silverwind.io> (https://silverwind.io)"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"tilde",
|
||||
"expansion",
|
||||
"expand",
|
||||
"untildify",
|
||||
"path",
|
||||
"home",
|
||||
"dir",
|
||||
"directory",
|
||||
"user",
|
||||
"shell",
|
||||
"bash"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"xo": {
|
||||
"esnext": true
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
# untildify [](https://travis-ci.org/sindresorhus/untildify)
|
||||
|
||||
> Convert a tilde path to an absolute path: `~/dev` => `/Users/sindresorhus/dev`
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save untildify
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const untildify = require('untildify');
|
||||
|
||||
untildify('~/dev');
|
||||
//=> '/Users/sindresorhus/dev'
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
See [tildify](https://github.com/sindresorhus/tildify) for the inverse.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
Reference in New Issue
Block a user