Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update @sasjs/utils version #1298

Merged
merged 3 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@sasjs/adapter": "4.1.0",
"@sasjs/core": "4.45.4",
"@sasjs/lint": "2.0.1",
"@sasjs/utils": "2.51.2",
"@sasjs/utils": "2.51.3",
"adm-zip": "0.5.9",
"chalk": "4.1.2",
"csv-stringify": "5.6.5",
Expand Down
17 changes: 12 additions & 5 deletions src/commands/fs/fsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
generateProgramToSyncHashDiff,
getRelativePath,
generateTimestamp,
SyncDirectoryMap
SyncDirectoryMap,
getAbsolutePath
} from '@sasjs/utils'
import { CommandOptions } from '../../types/command/commandBase'
import { executeCode } from './internal/executeCode'
Expand All @@ -30,7 +31,7 @@ const parseOptions = {
output: { type: 'string', alias: 'o' }
}

const compileCommandSyntax = 'fs <subCommand> <localFolder> [options]'
const compileCommandSyntax = 'fs <subCommand> <local> [options]'
const compileCommandUsage = 'sasjs fs compile <localFolder> [options]'
const compileCommandDescription =
'Compiles a SAS program with the contents of a local directory'
Expand Down Expand Up @@ -221,11 +222,15 @@ export class FSCommand extends TargetCommand {
)

process.logger?.info('creating the hash of local folder')
const localHash = await getHash(obj.local)
const localHash = await getHash(
getAbsolutePath(obj.local, process.projectDir)
)

const remoteHashMap = remoteHashes.reduce(
(map: { [key: string]: string }, item: any) => {
const relativePath = getRelativePath(obj.remote, item.FILE_PATH)
const from = obj.remote.replace(/\//g, path.sep)
const to = (item.FILE_PATH as string).replace(/\//g, path.sep)
const relativePath = getRelativePath(from, to)
map[relativePath] = item.FILE_HASH
return map
},
Expand Down Expand Up @@ -267,7 +272,9 @@ export class FSCommand extends TargetCommand {
)
const syncedHashMap = syncedHash.reduce(
(map: { [key: string]: string }, item: any) => {
const relativePath = getRelativePath(obj.remote, item.FILE_PATH)
const from = obj.remote.replace(/\//g, path.sep)
const to = (item.FILE_PATH as string).replace(/\//g, path.sep)
const relativePath = getRelativePath(from, to)
map[relativePath] = item.FILE_HASH
return map
},
Expand Down