Skip to content

Commit

Permalink
Reuse _getCorrectedRelativePath for recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeni Dmitriev committed Oct 19, 2016
1 parent 86ec1bc commit 0224b25
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/stylco.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ module.exports = function (debug) {
files_create_result,
indexfile_path,
buildfile_path,
buildfile_path_dir,
buildfile_existed,
buildfile_line,
buildfile_content_existing,
Expand Down Expand Up @@ -157,13 +156,12 @@ module.exports = function (debug) {
}

// Build up import line: either explicit (indexfile name) or implicit (component dir) indexfile import
buildfile_path_dir = path.parse(buildfile_path)['dir'];
if (this._config.buildfile_explicit_indexfile_import && _isString(this._config.indexfile_id)) {
indexfile_path = this._getFilePath(
component_name, this._config.indexfile_id, destination_dir, this._config.import_with_ext);
buildfile_line = this._getImportLine(path.relative(buildfile_path_dir, indexfile_path));
buildfile_line = this._getImportLine(_getCorrectedRelativePath(buildfile_path, indexfile_path));
} else {
buildfile_line = this._getImportLine(path.relative(buildfile_path_dir, destination_dir), true);
buildfile_line = this._getImportLine(_getCorrectedRelativePath(buildfile_path, destination_dir), true);
}

// Combine import line with newline, if necessary
Expand Down

0 comments on commit 0224b25

Please sign in to comment.